javascript 如何验证我的谷歌地图 API 密钥是否有效?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/55419000/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I verify if my google maps API key is valid?
提问by R.P.
I am trying to set up a new application to use a google map. I got the api key from another teammate who did the set up. I am wondering if there's a utility or some other way to check if the api key he gave me is valid. I am getting the following console error when running my application using the api key he gave me:
我正在尝试设置一个新的应用程序来使用谷歌地图。我从另一位进行设置的队友那里获得了 api 密钥。我想知道是否有实用程序或其他方法可以检查他给我的 api 密钥是否有效。使用他给我的 api 密钥运行我的应用程序时,我收到以下控制台错误:
Google Maps JavaScript API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error- messages#no-api-keys xw.m @ util.js:219 (anonymous) @ js?key [key]&callback=initMap:122 Promise.then (async)(anonymous) @ js?key=[key]&callback=initMap:122
回答by OlaJens
There is a google chrome addon for that: https://chrome.google.com/webstore/detail/google-maps-platform-api/mlikepnkghhlnkgeejmlkfeheihlehne
有一个谷歌浏览器插件:https: //chrome.google.com/webstore/detail/google-maps-platform-api/mlikepnkghhlnkgeejmlkfeheihlehne

