ghostcode
7/13/2014 - 10:54 PM

Web Mobile 获取地理位置

Web Mobile 获取地理位置

使用GeoLocation API获取地理位置:

navigator.geolocation.getCurrentPosition(GetLocation);
function GetLocation(location) {
    alert(location.coords.latitude);
    alert(location.coords.longitude);
    alert(location.coords.accuracy);
}