lingyired
V2EX  ›  问与答

关于 Web 的地理位置定位

  •  
  •   lingyired · Mar 13, 2015 · 1762 views
    This topic created in 4120 days ago, the information mentioned may be changed or developed.
    我们的 WebSite 需要地理位置定位功能,WebSite for PC 和 iPhone&Android。
    现在我的做法是先使用 navigator.geolocation.getCurrentPosition 尝试直接获取设备的位置,如果失败,则使用 geoip (类似)的服务来根据用户 IP 来获得地理位置。

    但实际使用的时候发现, navigator.geolocation.getCurrentPosition 这个 api 十分不稳定,经常的出现无法获取的情况(PC 和 iPhone 都这样)。

    那么是否有更好好的地理位置定位的方式(for web)?

    我们有想过要使用 The Google Maps Geolocation API for Business ,但是目前没找到在 WebSite 下面的使用方式。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5834 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 02:45 · PVG 10:45 · LAX 19:45 · JFK 22:45
    ♥ Do have faith in what you're doing.