【问题标题】:how to include googe maps api key in rd google map plugin如何在 rd 谷歌地图插件中包含谷歌地图 api 密钥
【发布时间】:2018-05-08 18:46:15
【问题描述】:

我正在使用 RD Google Map 插件,但我找不到 google api 脚本

页面不显示地图并显示此错误和灰色区域而不是地图

js?sensor=false&libraries=geometry,places&v=3.7&_=1525804623037:40 Google Maps API 错误:MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error

然后我尝试添加这个脚本行来初始化谷歌地图

      <script src="https://maps.googleapis.com/maps/api/js?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" type="text/javascript"></script>

但这次地图根本没有显示

出现这个错误

js?sensor=false&libr…&_=1525804236821:96 您已在此页面上多次包含 Google Maps API。这可能会导致意外错误。

如果我包含脚本,它说它被包含多次,如果我排除它,它说没有键

请指教

提前致谢

【问题讨论】:

  • 正如错误消息所说,您的 HTML 可能有多个 JS API 脚本加载。您需要找到https://maps.googleapis.com/maps/api/js? 所在的所有位置,删除除一个以外的所有位置,并在其中包含您的 API 密钥

标签: javascript html google-maps google-api api-key


【解决方案1】:

经过更多的搜索和挖掘,我在这里找到了答案

MissingKeyMapError when configuring Google Maps API

我尝试了解决方案,发现它很有帮助,问题已经解决了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-30
    • 2013-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-20
    相关资源
    最近更新 更多