问题描述
我在我的网站上收到此错误,该错误要求用户提供地理位置数据:
I am getting this error on my website which requests Geolocation data from the user:
getCurrentPosition() 和 watchPosition() 在不安全的来源上被弃用,并且支持将在未来被删除.您应该考虑将应用程序切换到安全源,例如 HTTPS.请参阅 goo.gl/rStTGz 了解更多详情.
getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See goo.gl/rStTGz for more details.
我的意思是它基本上只是一个通知,谷歌链接只是说它已被弃用.
I mean its basically just a notice, and the google link just says its being deprecated.
我没有将我的网站迁移到 SSL 的计划...那么像我这样的人有其他选择吗?
I have no plans on moving my website to SSL... so is there an alternative for someone like me?
推荐答案
在/jstillwell 的帖子中找到了可能的答案:https://github.com/stefanocudini/leaflet-gps/issues/15基本上将来不会支持此功能(仅在 Chrome 中?),但仅适用于 HTTP 站点.HTTPS 仍然可以,并且没有计划为 HTTP 使用创建等效替代品.
Found a likely answer in /jstillwell's posts here: https://github.com/stefanocudini/leaflet-gps/issues/15 basically this feature will not be supported (in Chrome only?) in the future, but only for HTTP sites. HTTPS will still be ok, and there are no plans to create an equivalent replacement for HTTP use.
这篇关于getCurrentPosition() 和 watchPosition() 在不安全的来源上被弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!