HTML5 Geolocation, GPS Only

12,449

I don't believe it's possible, the best you can do is pass true for enableHighAccuracy and use a heuristic based on the accuracy value.

--Edit

I saw a presentation by Remy Sharp last month and he had a useful suggestion: if you use watchPosition instead of getCurrentPosition then you can wait until the location information becomes accurate enough; GPS often takes some time to lock on to satellites so usually getCurrentPosition will just return something from one of the less accurate but more responsive methods.

Share:
12,449

Related videos on Youtube

John
Author by

John

I attempt to make cool things.

Updated on March 27, 2020

Comments

  • John
    John about 4 years

    Is there a way to make HTML5's Geolocation only work, if it is using a GPS device to get the location?

  • Kevin
    Kevin almost 14 years
    Yep, I'd second this. The implementation on the browser controls how location is determined and they pretty much all try most accurate (GPS) and fall back to network based detection.
  • John
    John about 11 years
    Yes, that is actually how I ended up implementing what I needed. Watching the accuracy until it was in a desired range allowed me to verify a user's location using a mobile web app.