谷歌地图使用

Posted mracale

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了谷歌地图使用相关的知识,希望对你有一定的参考价值。

浏览器获取经纬度:

<script>
navigator.geolocation.getCurrentPosition(function(pos,error){
    if(!navigator.geolocation) throw "geolocation not support";
         latitude=pos.coords.latitude;                  
         longitude=pos.coords.longitude;
        var accuracy=pos.coords.accuracy;
        console.log("当前位置:经度:"+latitude+" 纬度:"+longitude+" 精度:"+accuracy);
});
</script>

  

以上是关于谷歌地图使用的主要内容,如果未能解决你的问题,请参考以下文章