How does a browser get GPS data from a computer?

后端 未结 2 1857
孤街浪徒
孤街浪徒 2021-01-12 20:09

HTML5 browser can retrive the gps position of a computer. http://diveintohtml5.ep.io/geolocation.html

I would like to create an application that fakes a GPS device,

相关标签:
2条回答
  • 2021-01-12 20:40

    Chrome and Firefox:

    • GPS via gpsd if available (Linux only) 1, 2
    • system's Location API (Windows 7 only) 2
    • WiFi networks via Google Location Services 1
    0 讨论(0)
  • 2021-01-12 20:57

    GPS coordinates are available only on mobile browsers. What you are discussing is geolocation generally. Your dekstop or laptop computer does not have GPS device. Locations are expressed in latitude and longitude.

    For iOS use iOS emulator. You can set fake GPS coordinates. You can download it from developer.apple.com.

    For Android use Android emulator. You can set fake GPS coordinates. Google Android SDK.

    For other browsers / mobile vendors download the corresponding emuator.

    Desktop browsers do not use GPS data. They use either IP based or WLAN based locationing. For desktop browsers just write your own test stub for navigator.geolocation.

    0 讨论(0)
提交回复
热议问题