亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

WeChat アプレット開発ドキュメント / 微信小程序API 查看位置

微信小程序API 查看位置

wx.openLocation(OBJECT)


使用微信內(nèi)置地圖查看位置

OBEJCT參數(shù)說明:

QQ截圖20170208113613.png

示例代碼:

wx.getLocation({
  type: 'gcj02', //返回可以用于wx.openLocation的經(jīng)緯度
  success: function(res) {    var latitude = res.latitude    var longitude = res.longitude
    wx.openLocation({
      latitude: latitude,
      longitude: longitude,
      scale: 28
    })
  }
})


Bug & Tip

  1. bug: iOS 6.3.30 type 參數(shù)不生效,只會返回 wgs84 類型的坐標信息
  2. tip: wx.getLocationwx.chooseLocation 接口需要用戶授權(quán),請兼容用戶拒絕授權(quán)的場景。