如何向访客显示地理位置 [英] How to show visitors geo location
本文介绍了如何向访客显示地理位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何向访客展示地理位置?
How to show visitors Geo Location ?
推荐答案
请参阅此处:使用基于IP的地理位置 - 以及为什么它几乎没用。 [ ^ ] - 包括您需要的代码,但是。 ..在你决定继续之前阅读整篇文章!
See here: Using IP based Geolocation - and why it's pretty much useless.[^] - in includes the code you need, but ... read the whole thing before you decide to proceed!
考虑调查HTML5地理位置API。
HTML5演示:地理定位 [ ^ ]
[W3 Schools] HTML5 Geolocation [ ^ ]
这种方法需要es用户工作的权限,但它通常比IP地理定位更有用,因为如果设备(例如,移动电话)支持GPS定位,那么它将使用GPS。如果不支持GPS,浏览器将自动回退到IP地理位置。
Consider investigating the HTML5 geolocation API.
HTML5 Demo: geolocation[^]
[W3 Schools] HTML5 Geolocation[^]
This method requires user permission to work, however it is often far more useful than IP geolocation because if a device (eg, a mobile phone) supports GPS location, than it will use GPS. If GPS is not supported, the browser automatically falls back to IP geolocation.
这篇关于如何向访客显示地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文