|
@@ -9,6 +9,7 @@
|
|
|
show-location
|
|
|
:markers="markers"
|
|
|
:polyline="polyline"
|
|
|
+ @markertap="markertap"
|
|
|
style="width: 100%; height:100%;">
|
|
|
</map>
|
|
|
</view>
|
|
@@ -42,13 +43,14 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- //
|
|
|
+ // 标注点信息
|
|
|
getCleanWay(){
|
|
|
getCleanWay({ lng: this.longitude, lat: this.latitude }).then(res => {
|
|
|
if(res.status == 200){
|
|
|
this.markers = []
|
|
|
- res.data.map(item => {
|
|
|
+ res.data.map((item, index) => {
|
|
|
this.markers.push({
|
|
|
+ id: index+1,
|
|
|
latitude: item.lat,
|
|
|
longitude: item.lng,
|
|
|
width: '60rpx',
|
|
@@ -76,7 +78,8 @@
|
|
|
{latitude: null, longitude: null},
|
|
|
{latitude: null, longitude: null}
|
|
|
],
|
|
|
- width: 4,
|
|
|
+ arrowLine: true,
|
|
|
+ width: 6,
|
|
|
color: '#07c160'
|
|
|
})
|
|
|
if(index==0){
|
|
@@ -92,6 +95,20 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ },
|
|
|
+ // 点击标注点,调用第三方地图查看规划路线
|
|
|
+ markertap(e){
|
|
|
+ this.markers.map(item => {
|
|
|
+ if(item.id == e.detail.markerId){
|
|
|
+ uni.openLocation({
|
|
|
+ latitude: item.latitude,
|
|
|
+ longitude: item.longitude,
|
|
|
+ success: function () {
|
|
|
+ console.log('success');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|