配置 Google Maps API 时出现 MissingKeyMapError [英] MissingKeyMapError when configuring Google Maps API

查看:58
本文介绍了配置 Google Maps API 时出现 MissingKeyMapError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试像这样在我的网站上配置 Google Maps API 密钥:

<div class="border-bottom"></div><div id="google-map" class="rd-google-map__model" data-zoom="10" data-x="77.079627" data-y="28.643150"></div><ul class="rd-google-map__locations"><li data-x="77.079627" data-y="28.643150"><p>58, Ist Floor, DDA Local Shopping Centre, Block J, Vikaspuri, Del 110018</p>

我收到以下错误:

<块引用>

"Google Maps API 错误:MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error http://maps.google.com/maps/api/js:34"

URL 是 dranandspetsclinic.com/new/.

解决方案

打开 js/script.js 并搜索类似这样的行

$.getScript("http://maps.google.com/maps/api/js?sensor=false&libraries=geometry,places&v=3.7&key=ADD_YOUR_KEY_HERE", function ()

并从 添加 &key=your_key_herehttps://developers.google.com/maps/documentation/javascript/get-api-key?refresh=1

I am trying to configure the Google Maps API key on my website like this:

<div class="rd-google-map">
  <div class="border-bottom"></div>
  <div id="google-map" class="rd-google-map__model" data-zoom="10" data-x="77.079627" data-y="28.643150"></div>
  <ul class="rd-google-map__locations">
    <li data-x="77.079627" data-y="28.643150">
      <p>58, Ist Floor, DDA Local Shopping Centre, Block J, Vikaspuri, Delhi, 110018</p>
    </li>
  </ul>
</div>

I get the following error:

"Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error  http://maps.google.com/maps/api/js:34"

The URl is dranandspetsclinic.com/new/.

解决方案

Open js/script.js and search for a line with something like this

$.getScript("http://maps.google.com/maps/api/js?sensor=false&libraries=geometry,places&v=3.7&key=ADD_YOUR_KEY_HERE", function ()

and add the &key=your_key_here from https://developers.google.com/maps/documentation/javascript/get-api-key?refresh=1

这篇关于配置 Google Maps API 时出现 MissingKeyMapError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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