if (parent.wx && !isWinWxWork) {
parent.wx.getLocation({
type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
success: function (res) {
var latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
var longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
onComplete(longitude, latitude);
},
fail: function (res) {
getCurrentPosition();
}
});
}
else {
getCurrentPosition();
}
wx环境 iframe窗口里,可以调用wx 位置定位基础能力
最新推荐文章于 2024-07-08 16:22:29 发布