小程序地图展示指定位置并调用手机地图APP - 详细教程
{"usingComponents": {"map": "/path/to/map/component"}}Page({data: {longitude: 0,latitude: 0},onLoad: function(options) {wx.getLocation({type: 'gcj02',success: (res) => {this.setData({longitude: res.longitude,latitude: res.latitude})}})},openMapApp: function() {wx.openLocation({longitude: this.data.longitude,latitude: this.data.latitude,scale: 18,name: '指定位置',address: '指定位置的详细地址'})}})
原文地址: https://www.cveoy.top/t/topic/pSF0 著作权归作者所有。请勿转载和采集!