function locationFinder() {
if (navigator.geolocation) {
function success(pos) {
current_lng = pos.coords.longitude;
current_lat = pos.coords.latitude;
console.log("longitude get" + current_lng);
console.log("latitude get" + current_lat);
}
function fail(error) {
console.log("error 2");
}
// Find the users current position. Cache the location for 5 minutes,
// timeout after 6 seconds
navigator.geolocation.getCurrentPosition(success, fail, {
maximumAge : 500000,
enableHighAccuracy : true,
timeout : 6000
});
} else {
window.plugins.toast.showLongBottom("Please check GPS Setting",
function(a) {
console.log('toast success: ' + a)
}, function(b) {
console.log('toast error: ' + b)
});
}
}