星期一, 7月 21, 2014

HTML截取定位資訊轉存至THREE.js

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;
}

沒有留言:

張貼留言