Get watch current location in web application
To watch your current location you can use watchPosition() method from Geolocation API (and method clearWatch() to stop watching). Also don't forget to add "location" privilage and "location.gps" feature to config.xml.
// code (config.xml):
<tizen:privilege name="http://tizen.org/privilege/location"/>
<feature name="http://tizen.org/feature/location.gps"/>
// code (main.js):
var options = {enableHighAccuracy: true, maximumAge: 600000, timeout: 0};
var watchID;
function successCallback(position)
{
console.log(position);
}
function errorCallback(error)
{
console.log(error);
}
// start watching current location
var watchID = navigator.geolocation.watchPosition(successCallback, errorCallback, options);
// stop watching
navigator.geolocation.clearWatch(watchID);