10.打开地图选择位置。

2019-08-20  本文已影响0人  赵羽珩

wx.chooseLocation

image.png

map.js

Page({

  /**
   * 页面的初始数据
   */
  data: {
    myaddress: [],
  },

  /**
   * 地图
   */
    changelocation() {
        wx.chooseLocation({
            success: (res) => {
                this.setData({
                    myaddress: res.address
                })
            },
        })
    },
})
image.png

map.wxml

<text>定位:{{myaddress}}</text>
<button bindtap="changelocation">地图</button>
上一篇 下一篇

猜你喜欢

热点阅读