Commit 5c7b1ebf authored by 纪泽龙's avatar 纪泽龙

增加回放小车的点

parent 357e616d
/*
* @Author: your name
* @Date: 2022-01-11 13:45:12
* @LastEditTime: 2022-03-21 17:43:29
* @LastEditTime: 2022-03-21 18:13:58
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/utils/mapClass.js
......@@ -682,7 +682,7 @@ export class EditorMap {
* @param {*} path 轨迹回访率丼
* @return {*}
*/
backTrack(vehicleId, path,times) {
backTrack(vehicleId, path, times) {
this.infowindowClose();
AMap.plugin("AMap.MoveAnimation", () => {
......@@ -712,13 +712,15 @@ export class EditorMap {
});
// 每个path的点
marker.pointArr = [];
// marker.pointArr = [];
// carTarget
//点击的时候,先传进来一个点
const carPathData = { ...marker.getExtData() };
const carPathData = { ...marker.getExtData(), time: times[0] };
carPathData.iconType = 14;
this.addDevice(carPathData,null);
this.addDevice(carPathData, null);
// marker.pointArr.push(point);
marker.on("moveend", (e) => {
// this.addDevice(carPathData,carBackComponent);
// 如果不是最后一个点,就创建一个新的worderpoint,如果是就不创建,并且把自身删除
......@@ -726,14 +728,15 @@ export class EditorMap {
let z = {
longitude: e.pos[0],
latitude: e.pos[1],
iconType: 14,
time: times[e.index],
};
if (e.index == path.length - 1) {
} else {
this.addDevice(z, null);
// workPoint.infoWindow.open(map,e.passedPos);
marker.pointArr.push(workPoint);
}
// if (e.index == path.length - 1) {
// point = this.addDevice(z, null);
// } else {
this.addDevice(z, null);
// workPoint.infoWindow.open(map,e.passedPos);
// }
console.log("定点", e);
});
......@@ -755,9 +758,8 @@ export class EditorMap {
// 停止运动
item.stopMove();
// 删除每个点
item.pointArr?.forEach((iten) => {
this.map.remove(iten);
});
console.log(item.pointArr);
if (item.polyline) {
this.map.remove(item.polyline);
}
......@@ -770,6 +772,9 @@ export class EditorMap {
// 最后把数组清空
this.allDevice["9"] = [];
// 把car的路径点也清空
this.allDevice["14"]?.forEach((iten) => {
this.map.remove(iten);
});
this.allDevice["14"] = [];
this.infowindowClose();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment