修复动态筛选路线
This commit is contained in:
parent
1da688a585
commit
9122f3be17
@ -160,8 +160,8 @@ const feature = reactive({
|
|||||||
showFixed: false
|
showFixed: false
|
||||||
})
|
})
|
||||||
function play(item){
|
function play(item){
|
||||||
console.log(item)
|
console.log(item,view.lines,data.polylines)
|
||||||
playAnimation(map,data,view.lines[item.value],data.polylines[item.value])
|
playAnimation(map,data,view.lines[item.value])
|
||||||
}
|
}
|
||||||
// 地图实例 和 数据不要交给 vue 管理 否则性能大打折扣 且 会有各种奇葩问题
|
// 地图实例 和 数据不要交给 vue 管理 否则性能大打折扣 且 会有各种奇葩问题
|
||||||
let map = {}
|
let map = {}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export function playAnimation(map,data,line,polyline){
|
export function playAnimation(map,data,line){
|
||||||
console.log("playAnimation",line,polyline)
|
console.log("playAnimation",line)
|
||||||
if(!data.animateMarker){
|
if(!data.animateMarker){
|
||||||
data.animateMarker = new AMap.Marker({
|
data.animateMarker = new AMap.Marker({
|
||||||
map: map,
|
map: map,
|
||||||
@ -23,6 +23,9 @@ export function playAnimation(map,data,line,polyline){
|
|||||||
// map.remove(data.animateMarker)
|
// map.remove(data.animateMarker)
|
||||||
// },100)
|
// },100)
|
||||||
})
|
})
|
||||||
|
let polyline = new AMap.Polyline({
|
||||||
|
path: path,
|
||||||
|
})
|
||||||
data.animateMarker.moveAlong(polyline.getPath(),{
|
data.animateMarker.moveAlong(polyline.getPath(),{
|
||||||
duration: 1000/60,
|
duration: 1000/60,
|
||||||
autoRotation: true
|
autoRotation: true
|
||||||
|
Loading…
Reference in New Issue
Block a user