fix: 增加Route中Ship类型时的移动图片
This commit is contained in:
parent
47aaa0d794
commit
653ba9a7c8
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -16,3 +16,4 @@ dist
|
|||
## front
|
||||
/yarn-error.log
|
||||
dist.zip
|
||||
.vscode/settings.json
|
||||
|
|
|
@ -135,8 +135,12 @@ export default {
|
|||
)
|
||||
},
|
||||
|
||||
// 按路线运动
|
||||
animateByRoute(coordinates) {
|
||||
/**
|
||||
* 按路线运动
|
||||
* @param coordinates 坐标
|
||||
* @param { 'Car' | 'Ship' } type 类型
|
||||
*/
|
||||
animateByRoute(coordinates, type) {
|
||||
if (!coordinates) {
|
||||
return
|
||||
}
|
||||
|
@ -158,7 +162,7 @@ export default {
|
|||
},
|
||||
{
|
||||
image: new Icon({
|
||||
src: MarkerIcon[MarkerType.Car],
|
||||
src: MarkerIcon[MarkerType[type]],
|
||||
anchor: [0.65, 0.5],
|
||||
}),
|
||||
},
|
||||
|
|
|
@ -553,7 +553,7 @@ export default {
|
|||
// 如果切换到轨迹绘制页面,则使用上一次的轨迹先绘制一遍
|
||||
if (active == 3) {
|
||||
if (this.lastRoute) {
|
||||
this.$emit('drawRoute', this.lastRoute)
|
||||
this.$emit('drawRoute', this.lastRoute, this.lastRouteType)
|
||||
}
|
||||
|
||||
this.$emit('changeMarker', [])
|
||||
|
@ -912,8 +912,10 @@ export default {
|
|||
}
|
||||
|
||||
this.lastRoute = result.map(({ lon, lat }) => [lon, lat])
|
||||
const find = this.stationSelectOptions.find((item) => item.value == this.routeParams.stationCode)
|
||||
this.lastRouteType = find ? find.stationType : 'Car'
|
||||
|
||||
this.$emit('drawRoute', this.lastRoute)
|
||||
this.$emit('drawRoute', this.lastRoute, this.lastRouteType)
|
||||
} else {
|
||||
this.$message.error(message)
|
||||
}
|
||||
|
@ -945,9 +947,10 @@ export default {
|
|||
stationSelectOptions() {
|
||||
return this.originalDataList
|
||||
.filter(({ stationType }) => stationType == 'Car' || stationType == 'Ship')
|
||||
.map(({ stationName: label }) => ({
|
||||
.map(({ stationName: label, stationType }) => ({
|
||||
label,
|
||||
value: label,
|
||||
stationType,
|
||||
}))
|
||||
},
|
||||
},
|
||||
|
|
|
@ -565,8 +565,8 @@ export default {
|
|||
},
|
||||
|
||||
// 绘制轨迹
|
||||
handleDrawRoute(routes) {
|
||||
this.$refs.mapRef.animateByRoute(routes)
|
||||
handleDrawRoute(routes, type) {
|
||||
this.$refs.mapRef.animateByRoute(routes, type)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user