我是参考https://blog.csdn.net/zyj12138/article/details/112463219这个地址完成的
先看结果
代码
<map
style="width: 750rpx; height: 100vh;"
id="myMap"
ref="myMap"
:latitude="latitude"
:longitude="longitude"
:scale="16"
:show-location="true"
:enable-satellite="true"
:polyline="markerPolyline"
:markers="markerPoints"
:polygon="markerPolygon"
@tap="tapMap"
/>
data() {
return {
latitude: 41.67718,
longitude: 123.4631,
landPoints: []
};
},
onLoad() {
uni.getLocation({
geocode: true,
success: res => {
this.latitude = res.latitude;
this.longitude = res.longitude;
}
});
},
computed: {
markerPoints() {
if (this.landPoints.len