手册
目录
收藏733
分享
阅读91490
更新时间2022-04-11
微信小程序获取当前的地理位置、速度
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;
}
});
微信小程序使用微信内置地图查看位置
OBEJCT参数说明:

示例代码:
wx.getLocation({
type: 'gcj02', //返回可以用于wx.openLocation的经纬度
success: function (res) {
var latitude = res.latitude;
var longitude = res.longitude;
wx.openLocation({
latitude:latitude,
longitude:logitude,
scale:1
})
}
}); 相关
视频
RELATED VIDEOS
科技资讯
1
2
3
4
5
6
7
8
9
精选课程
共5课时
17.3万人学习
共49课时
77.4万人学习
共29课时
62万人学习
共25课时
39.5万人学习
共43课时
71.3万人学习
共25课时
61.9万人学习
共22课时
23.1万人学习
共28课时
34.1万人学习
共89课时
125.8万人学习