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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 10:32:38  来源:igfitidea点击:

How can I verify if my google maps API key is valid?

javascripthtmlmaps

提问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