安全和隐私
用户通过浏览器对话框接受您的网站访问他们的位置,所以你不能在它们不知道的情况下使用它进行间谍活动。
navigator.geolocation.getCurrentPosition(
function(position) {
alert("your position is: "
+ position.coords.latitude + ", "
+ position.coords.longitude);
}
);
double latitude // read only attribute
double longitude // read only attribute
double accuracy // read only attribute
double altitude // read only attribute
double altitudeAccuracy // read only attribute
double heading // read only attribute
double speed // read only attribute