微信小程序 框架
微信小程序 WXML
表单组件
微信小程序导航
地图
媒体
绘图
开放接口
工具
使用微信内置地图查看位置
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
})
}
})
bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息tip: wx.getLocation、wx.chooseLocation 接口需要用户授权,请兼容用户拒绝授权的场景。