Deprecation of V2

放肆的年华 提交于 2019-12-11 19:39:11

问题


I have an application calling the v2 api without key using:

<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key="></script>

This has stopped working over the past couple of days. Console is showing only one error:

Control is no longer supported in the Google Maps Javascript API v2...

However, whichever way I try and call the v3 API, I get an error :

"Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v3 on this site"

I have checked, and re-connected a valid bank card to the account (although the outstanding balance was $0.00) This payment appears not to have been registered.

Any leaders on where to go next?


回答1:


Don't use the Google Maps Javascript API v2, it is deprecated and has been turned off, replaced with a simple wrapper for the Google Maps Javascript API v3

From the error you report in the console, the functionality you are attempting to use is not available in the wrapper.

Port your code to v3 ASAP.




回答2:


See https://developers.google.com/maps/documentation/javascript/v2/v2tov3#overview

You need to register a new API key.




回答3:


Loading the Google Maps API page states to use this code with a new API key placed into the code at API_KEY and you will probably need to set your sensor to FALSE, also you may need to place the new API key into your application settings page.

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=API_KEY&sensor=FALSE">
</script>



来源:https://stackoverflow.com/questions/20097316/deprecation-of-v2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!