if (navigator.geolocation) {
setInterval("enableGeolocation()",5000);
} else {
alert("Geolocation is not supported by this browser.");
}
function enableGeolocation() {
navigator.geolocation.getCurrentPosition(showPosition);
}
function showPosition(position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
}
沒有留言:
張貼留言