简体   繁体   中英

Offline user location in Mapbox

Is it possible to update user's location without using the network? I'm using MapBox for my application, and i really need to know about it. It seems obvious that user can see where he is using GPS, but I am not sure yet.

you mean locally? you can get GPS location on devices and via the browser's HTML5 GeoLocation, and technically just feed that to the mapbox map via the regular javascript (assuming you have the required files accessible locally).

http://www.w3.org/TR/geolocation-API/

here's an example using google maps:

http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation_map

the location isn't 100% accurate as it guesses by IP address, WiFi signals and GPS data (if available).

you didn't specify, but if you're talking about native code, you can do the same thing with different methods on iOS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM