微信小程序点击地图打开高德地图、百度地图
北京的北京 时间:2022-08-22
1.小程序中使用map组件map | 微信开放文档
- <map @click="goMap" >">"info.latitude"
- :longitude="info.longitude" :markers="markers" :enable-poi="true"
- subkey='7SQBZ-3GDCI-RTUGE-5FOI7-B7GEV-I4FSB' layer->'4' scale="15"></map>
2.使用微信内置地图查看位置wx.openLocation,这一步便是打开地图软件的关键
官文地址:wx.openLocation(Object object) | 微信开放文档
写完下面方法即可调起选择地图软件弹窗了
- goMap() {
- wx.openLocation({
- latitude: Number(this.info.latitude),
- longitude: Number(this.info.longitude),
- name: this.info.title,
- address: this.info.province_name + this.info.city_name + this.info.area_name + this.info.address,
- scale: 28
- })
- },
特别声明:本站部分内容收集于互联网是出于更直观传递信息的目的。该内容版权归原作者所有,并不代表本站赞同其观点和对其真实性负责。如该内容涉及任何第三方合法权利,请及时与824310991@qq.com联系,我们会及时反馈并处理完毕。