MissingKeyMapError when configuring Google Maps API

强颜欢笑 提交于 2020-01-24 22:50:30

问题


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/.


回答1:


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



来源:https://stackoverflow.com/questions/41566791/missingkeymaperror-when-configuring-google-maps-api

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