標簽:open 微信 小程序 oca alt ati function 經緯度 坐標
獲取當前的地理位置、速度。
OBJECT參數說明:
success返回參數說明:
示例代碼:
wx.getLocation({ type: ‘wgs84‘, success: function(res) { var latitude = res.latitude var longitude = res.longitude var speed = res.speed var accuracy = res.accuracy } })
打開地圖選擇位置
OBJECT參數說明:
success返回參數說明:
? 使用微信内置地图查看位置
OBEJCT參數說明:
示例代碼:
wx.getLocation({ type: ‘gcj02‘, //返回可以用于wx.openLocation的經緯度 success: function(res) { var latitude = res.latitude var longitude = res.longitude wx.openLocation({ latitude: latitude, longitude: longitude, scale: 28 }) } })
標簽:open 微信 小程序 oca alt ati function 經緯度 坐標
原文地址:http://www.cnblogs.com/phpshen/p/6073187.html