WeChat Mini Program API Check Location
wx.openLocation(OBJECT)
Use WeChat’s built-in map to view the location
OBEJCT parameter description:
Sample code:
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
:
iOSThe type parameter does not take effect, only wgs84 type coordinate information will be returned
- tip
:
wx.getLocation,
wx.chooseLocationinterfaces require user authorization, please be compatible with the scenario where the user refuses authorization.