gpt4 book ai didi

javascript - 带有谷歌地图的AWS服务器

转载 作者:太空宇宙 更新时间:2023-11-04 02:05:26 24 4
gpt4 key购买 nike

我正在为我的应用程序使用 AWS 服务器。当我使用 localhost 运行我的应用程序时,我在使用谷歌地图时遇到问题谷歌地图工作正常,但当我使用 IP 地址运行应用程序时,它不起作用。它给了我这个错误:

getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See for more details.

如何解决?

最佳答案

出现这种情况是由于使用了不安全的 URL,因此您可以使用以下解决方法 Google maps API,然后您可以使用 POST 注册并发送地理定位请求到以下 URL:

"https://www.googleapis.com/geolocation/v1/geolocate?key={{ 
registerd_Key}}"

关于javascript - 带有谷歌地图的AWS服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44518848/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com