<pre>// Function to get location function getLocation() { navigator.geolocation.getCurrentPosition(function (pos) { var lat = pos.coords.latitude; var lng = pos.coords.longitude; if (lat == null) { navigator.notification.alert("GPS not activated!", null, "GPS", "Ok"); } else { navigator.notification.alert("Latitude: " + lat + " , Longitude: " + lng, null, "GPS", "Ok"); } }); }</pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)