欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序在地圖選擇地址并返回經(jīng)緯度簡單示例

 更新時間:2018年12月03日 11:55:41   作者:kerryqpw  
這篇文章主要介紹了微信小程序在地圖選擇地址并返回經(jīng)緯度,涉及微信小程序針對經(jīng)緯度地址信息相關操作技巧,需要的朋友可以參考下

本文實例講述了微信小程序在地圖選擇地址并返回經(jīng)緯度功能。分享給大家供大家參考,具體如下:

微信小程序的地址管理中,經(jīng)常需要獲取地址的詳細地址信息和地址經(jīng)緯度信息

wxml文件部分代碼:

<button bindtap="mapView" style="margin:10px">查看地圖</button>

js文件主要功能代碼:

mapView:function(){
  var that = this
  wx.chooseLocation({
   success: function (res) {
    // success
    console.log(res,"location")
    that.setData({
     hasLocation: true,
     location: {
      longitude: res.longitude,
      latitude: res.latitude
     },
     detail_info: res.address,
     wd: res.latitude,
     jd: res.longitude
    })
   },
   fail: function () {
    // fail
   },
   complete: function () {
    // complete
   }
  })
}

運行效果:

希望本文所述對大家微信小程序設計有所幫助。

相關文章

最新評論