【问题标题】:js google maps showing dark screenjs谷歌地图显示黑屏
【发布时间】:2018-04-03 06:49:08
【问题描述】:

我有一个简单的代码,可以在谷歌地图上显示位置。但由于某些原因,它显示了一个黑屏。知道发生了什么吗?

    <html>
  <head>
  <title> Using Google Maps API in PHP- InfoTuts </title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>

</head>




    <div id="display_map" style="width:450px;height:350px; "></div> 

<div id="myad">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-9165168790934890";
/* top */
google_ad_slot = "6414226949";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> 
</div>

这是控制台:

【问题讨论】:

  • 请发布您的代码,否则您将得不到答复。

标签: javascript html wordpress google-maps google-maps-api-3


【解决方案1】:

您有 Google 应用密钥吗?

<script src="https://maps.googleapis.com/maps/api/js?key=<your app key>&callback=<your endpoint>"></script>

【讨论】:

  • 是的,我有它,但我找不到将它放在脚本中的位置。我尝试使用您的脚本,但这似乎是问题。
  • 您还需要在 Google 控制台中允许您的网址。看看我的站点地图效果很好link
猜你喜欢
  • 1970-01-01
  • 2017-03-26
  • 2017-12-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多