错误:谷歌地图 API 错误:MissingKeyMapError [英] ERROR: Google Maps API error: MissingKeyMapError

查看:24
本文介绍了错误:谷歌地图 API 错误:MissingKeyMapError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然出现以下 JavaScript 错误:

The following JavaScript error suddenly appeared:

Google Maps API 错误:Google Maps API 错误:MissingKeyMapError

Google Maps API error: Google Maps API error: MissingKeyMapError

推荐答案

是的.现在 Google 需要一个 API 密钥来验证用户访问他们的 API 的身份`.

您可以从以下链接获取 API 密钥.通过链接,您需要输入一个项目等等.但这很容易.无忧无虑.

You can get the API key from the following link. Go through the link and you need to enter a project and so on. But it is easy. Hassle free.

https://developers.google.com/maps/documentation/javascript/get-api-键

获得 API 密钥后,更改之前的

Once you get the API key change the previous

<script src="https://maps.googleapis.com/maps/api/js"></script>

<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=your_api_key_here"></script>

现在您的谷歌地图正在运行.如果您想将经度纬度输入到地图中.只需固定您想要的位置并检查浏览器的 URL.您可以在那里看到经度和纬度值.只需复制这些值并按如下方式粘贴即可.

Now your google map is in action. In case if you are wondering to get the longitude and latitude to input to Maps. Just pin the location you want and check the URL of the browser. You can see longitude and latitude values there. Just copy those values and paste it as follows.

new google.maps.LatLng(longitude ,latitude )

这篇关于错误:谷歌地图 API 错误:MissingKeyMapError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆