Answer the question
In order to leave comments, you need to log in
Apache Cordova how to get up-to-date geodata?
Apache Cordova how to get up-to-date geodata?
Updatecoord() {
var self = this;
console.log("Updatecoord run");
navigator.geolocation.getCurrentPosition(
function (position) {
var date = new Date();
date.setTime(position.timestamp);
console.log(
'Latitude: ' + position.coords.latitude + '\n' +
'Longitude: ' + position.coords.longitude + '\n' +
'Time: ' + date
);
self.SaveCoord(position);
},
function (error) {
console.log('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
},
{
enableHighAccuracy: true,
timeout: 20000,
maximumAge: 0,
}
);
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question