本地主机的谷歌地图api用法

Google map api usage for localhost

本文关键字:api 用法 谷歌地图 主机      更新时间:2023-09-26

嗨,我已经为谷歌地图生成了客户端密钥,现在我正在我的应用程序中使用,我收到了以下错误,有人能帮我如何使用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)column

中授权了我的本地主机地址

创建map api键时,只需将网站url输入留空。上面写着"如果你把它留空,你的地图请求将在任何地方工作"或类似的东西

我通过添加得到了解决方案http://localhost在Accept requests from these HTTP referrers(websites)column 中