php - Google Maps JavaScript API warning: NoApiKeys - Stack Overflow

Our site giving the warning prompt "This page can't load Google Maps correctly".I am us

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
Add a ment  | 

2 Answers 2

Reset to default 5

As 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745038433a4607664.html

相关推荐

  • php - Google Maps JavaScript API warning: NoApiKeys - Stack Overflow

    Our site giving the warning prompt "This page can't load Google Maps correctly".I am us

    9小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信