我们的网站出现警告提示:“此页面无法正确加载Google地图”。
我正在使用Symfony2的“ivory-google-map”捆绑包。
在控制台中,我们发现警告信息为:“Google Maps JavaScript API警告:NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys”。
非常感谢您的帮助。
我们的网站出现警告提示:“此页面无法正确加载Google地图”。
我正在使用Symfony2的“ivory-google-map”捆绑包。
在控制台中,我们发现警告信息为:“Google Maps JavaScript API警告:NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys”。
非常感谢您的帮助。
根据错误信息,您需要 APIKey 才能消除此错误。
您可以从 https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key 获取 APIKey。
然后,将该密钥应用到您的代码中:
<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" type="text/javascript"></script>
此后,上述错误将不再存在!
<div class="mapouter"><div class="gmap_canvas"><iframe width="600" height="500" id="gmap_canvas" src="https://maps.google.com/maps?q=university%20of%20san%20francisco&t=&z=13&ie=UTF8&iwloc=&output=embed" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe><a href="https://www.pureblack.de"></a></div><style>.mapouter{text-align:right;height:500px;width:600px;}.gmap_canvas {overflow:hidden;background:none!important;height:200px;width:300px;}</style></div>