【问题标题】:Google map api usage for localhost [duplicate]本地主机的谷歌地图api使用[重复]
【发布时间】:2016-12-02 10:07:52
【问题描述】:

您好,我已经为谷歌地图生成了客户端密钥,现在我在我的应用程序中使用我收到以下错误,谁能帮助我如何使用 localhost。

Google Maps API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: http://localhost:8085/ParticiPoint/#/createLocation

我已在Accept requests from these HTTP referrers (websites) 列中授权我的本地主机地址

【问题讨论】:

    标签: javascript angularjs google-maps google-maps-api-3


    【解决方案1】:

    当您创建地图 api 密钥时,只需将站点 url 输入留空。它说“如果你把它留空,你的地图请求将在任何地方工作”或某事。像这样

    【讨论】:

    • 这不是一个安全的解决方案,请改用@Sudhir 解决方案
    【解决方案2】:

    我通过在接受来自这些 HTTP 引荐来源(网站)列的请求中添加 http://localhost 得到了解决方案

    【讨论】:

      猜你喜欢
      • 2014-12-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-25
      相关资源
      最近更新 更多