标签:html5geolocation地理定位 html5 geolocation html5自定义开发
<html>
<head>
<title>Geolocation API地理定位</title>
<script type="text/javascript">
navigator.geolocation.getCurrentPostion(function(pos) {
console.log("当前地理位置的纬度:" + pos.coords.laitude);
console.log("当前地理位置的经度:" + pos.coords.longitude);
console.log("当前经纬度的经度:" + pos.coords.accuracy);
});
var watchID = navigator.geolocation.witchPosition(function(pos) {
console.log("当前位置变化的纬度:" + pos.coords.laitude);
console.log("当前位置变化的经度:" + pos.coords.longitude);
console.log("当前位置变化的经度:" + pos.coords.accuracy);
navigator.geolocation.clearwatch(watchID);
}, function() { });
</script>
</head>
<body>
</body>
</html>
标签:html5geolocation地理定位 html5 geolocation html5自定义开发
原文地址:http://blog.csdn.net/y_f123/article/details/42339517