Yes. You can definitely see the location in the background if your mobile browser supports the Geolocation API .
You can use the watchPosition() function.
watchPosition () Code snippet
var watchID = navigator.geolocation.watchPosition(function(position) { do_something(position.coords.latitude, position.coords.longitude); });
If the position data changes (either by movement of the device, or a lot of accurate geo-information), you can set up a callback function that is called with updated location information. Done using the watchPosition() function, which has the same input getCurrentPosition() parameters. The callback function is called several times, allowing the browser to either update your location, or you navigate or provide a more accurate location.
getCurrentPosition () Code snippet
navigator.geolocation.getCurrentPosition(function(position) { do_something(position.coords.latitude, position.coords.longitude); });
For more information, contact Mozilla / Geolocation / WatchCurrentPosition
Hope this helps!
krishnaxv
source share