一、概述
地理信息系统(Geographic Information System或 Geo-Information system,GIS)有时又称为“地学信息系统”。
二、小牛试刀,从获取当前经纬度开始
样例代码如下:
<!document html>
<html>
<head>
<script>
window.onload = function(){
show();
}
function show(){
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
function (position) {
var longitude = position.coords.longitude;
var latitude = position.coords.latitude;
alert("当前坐标: "+longitude+","+latitude)
},
function (e) {
var msg = e.code;
var dd = e.message;
console.log(msg)
console.log(dd)
}
)
}
}
</script>
</head>
<body>
<div style="width:100px;height:100px;background:#AAA" onclick="show()">
点我显示当前坐标
</div>
</body>
</html>
以上为入门测试。
更多精彩技术分享请浏览本人博客:https://blog.youkuaiyun.com/wohiusdashi