zhainverer
 js:
// 打开地图导航
  seeMap: function(e){
    var me = this;
    let id = e.currentTarget.dataset.id;
    var stores = me.data.data.data;
    var latitude = stores[id].latitude
    var longitude = stores[id].longitude
    var name = stores[id].store_name
    var details = stores[id].details
    wx.getLocation({
      type: \'wgs84\', 
      success: function (res) {
        console.log(\'打开地图导航去目的地\');
        wx.openLocation({//​使用微信内置地图查看位置。
          latitude: Number(latitude),//要去的纬度-地址
          longitude: Number(longitude),//要去的经度-地址
          name: name,
          address: details
        })
      }
    })
  },
 
 
wxml:
<view class="box2_son3_right2" data-id="{{index}}" bindtap="seeMap">
    <image src="../../images/icon/adr.png"/>
</view>

 

 

 

 

 
 
参考来源:https://blog.csdn.net/qq_36538012/article/details/88396041
 

分类:

技术点:

相关文章:

  • 2021-12-30
  • 2022-01-22
  • 2021-08-15
  • 2022-12-23
  • 2021-09-28
  • 2022-01-02
猜你喜欢
  • 2021-10-19
  • 2021-12-07
  • 2021-06-25
  • 2022-01-24
  • 2021-08-06
  • 2021-07-31
  • 2022-01-29
相关资源
相似解决方案