浏览器定位navigator.geolocation.getCurrentPosition
分类:Javascript 评论:No Comments 作者:小A 发布时间:2023-07-13 阅读:942
浏览器定位是可以使用javascript直接获取当前你的网络所在的位置信息,主要方法为
navigator.geolocation.getCurrentPosition(function(position){});
其中`position`信息中包括以下内容:
经度 : position.coords.longitude
纬度 : position.coords.latitude
精度 : position.coords.accuracy
高程 : position.coords.altitude
高程精度 : position.coords.altitudeAcuracy
方向 : position.coords.heading
速度 : position.coords.speed
时间戳 : position.timestamp
最新评论