地图 - 位置 - 导航
<map style="width: 100%; height: 244px" :latitude="lat" :longitude="lng" :markers="covers">
</map>
<image class="m_img" src="/" @click.stop="goStore(item.latitude, item.longitude)"></image>
lng: "",
lat: "",
covers: [{
id: 1,
latitude: "",
longitude: "",
iconPath:''
}],
uni.getLocation({
type: "wgs84",
success: function(res) {
this.lng = res.longitude;
this.lat = res.latitude;
this.getStore();
},
fail: function() {
uni.showModal({
title: "提示",
content: "定位失败,请检查您定位权限",
showCancel: false,
success: function(res) {
},
});
},
});
goStore(lat, lng) {
uni.openLocation({
latitude: Number(lat),
longitude: Number(lng),
success: function(res) {
},
});
},