admin管理员组文章数量:1406728
Our site giving the warning prompt "This page can't load Google Maps correctly". I am using "ivory-google-map" bundle of symfony2. In the console, we found the warning as "Google Maps JavaScript API warning: NoApiKeys " Any help would be really appreciated.
Our site giving the warning prompt "This page can't load Google Maps correctly". I am using "ivory-google-map" bundle of symfony2. In the console, we found the warning as "Google Maps JavaScript API warning: NoApiKeys https://developers.google./maps/documentation/javascript/error-messages#no-api-keys" Any help would be really appreciated.
Share Improve this question asked Aug 27, 2018 at 7:28 Vishal PawarVishal Pawar 691 silver badge5 bronze badges 1- 1 Google requires an API key for api calls. You will have to pay google to use their API. If you just need an interactive map with a location marker, you can use iframe. – Nicolo Lüscher Commented Aug 27, 2018 at 7:33
2 Answers
Reset to default 5As the error message says, you need APIKey to remove this error.
You can get APIKey from https://developers.google./maps/documentation/javascript/get-api-key#get-an-api-key
And apply that key to your code like :
<script async defer src="https://maps.googleapis./maps/api/js?key=YOUR_API_KEY&callback=initMap" type="text/javascript"></script>
After that above error will no longer exists!
If you don't want to buy an API key and you only need a static map, you can use an iFrame to do that.
<div class="mapouter"><div class="gmap_canvas"><iframe width="600" height="500" id="gmap_canvas" src="https://maps.google./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>
But I don't know how much longer this will be possible
本文标签: phpGoogle Maps JavaScript API warning NoApiKeysStack Overflow
版权声明:本文标题:php - Google Maps JavaScript API warning: NoApiKeys - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745038433a2638931.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论