Commit 892d05c7 authored by 纪泽龙's avatar 纪泽龙

Merge branch 'develop_jzl'

parents c5d81b4e 5c7b1ebf
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1647852854992" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2263" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M662.04973405 329.56834123l108.40905238-142.19888693c4.22372932-5.63163908 4.22372932-11.26327817 1.40790978-18.30282702-2.81581955-5.63163908-8.44745863-9.8553684-15.48700748-9.85536841H218.55815604c-9.8553684 0-16.89491725 7.03954885-16.89491725 16.89491726V867.38987389c0 9.8553684 7.03954885 16.89491725 16.89491725 16.89491726s16.89491725-7.03954885 16.89491726-16.89491726V487.25423562h522.33452519c7.03954885 0 12.67118794-4.22372932 15.48700749-9.8553684s1.40790977-12.67118794-2.81581955-18.30282703l-108.40905238-129.52769896z" fill="#EA4942" p-id="2264"></path></svg>
\ No newline at end of file
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-01-11 13:45:12 * @Date: 2022-01-11 13:45:12
* @LastEditTime: 2022-03-21 08:57:08 * @LastEditTime: 2022-03-21 18:13:58
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/utils/mapClass.js * @FilePath: /test/hello-world/src/utils/mapClass.js
...@@ -331,7 +331,11 @@ export class EditorMap { ...@@ -331,7 +331,11 @@ export class EditorMap {
const data = target.getExtData(); const data = target.getExtData();
console.log(data); console.log(data);
const name = const name =
data.nickName || data.deviceName || data.videoName || data.stationName; data.nickName ||
data.deviceName ||
data.videoName ||
data.stationName ||
data.time;
target.setLabel({ content: name, direction: "top" }); target.setLabel({ content: name, direction: "top" });
}); });
device.on("mouseout", (e) => { device.on("mouseout", (e) => {
...@@ -678,11 +682,13 @@ export class EditorMap { ...@@ -678,11 +682,13 @@ export class EditorMap {
* @param {*} path 轨迹回访率丼 * @param {*} path 轨迹回访率丼
* @return {*} * @return {*}
*/ */
backTrack(vehicleId, path) { backTrack(vehicleId, path, times) {
this.infowindowClose(); this.infowindowClose();
AMap.plugin("AMap.MoveAnimation", () => { AMap.plugin("AMap.MoveAnimation", () => {
let marker = this.allDevice[9].filter(item => item.getExtData().vehicleId == vehicleId)[0]; let marker = this.allDevice[9].filter(
(item) => item.getExtData().vehicleId == vehicleId
)[0];
// 绘制轨迹 // 绘制轨迹
marker.polyline = new AMap.Polyline({ marker.polyline = new AMap.Polyline({
...@@ -702,41 +708,74 @@ export class EditorMap { ...@@ -702,41 +708,74 @@ export class EditorMap {
marker.on("moving", (e) => { marker.on("moving", (e) => {
marker.passedPolyline.setPath(e.passedPath); marker.passedPolyline.setPath(e.passedPath);
// this.map.setCenter(e.target.getPosition(), true); // this.map.setCenter(e.target.getPosition(), true);
// console.log(getPosition());
}); });
marker.moveAlong(path , { // 每个path的点
// marker.pointArr = [];
// carTarget
//点击的时候,先传进来一个点
const carPathData = { ...marker.getExtData(), time: times[0] };
carPathData.iconType = 14;
this.addDevice(carPathData, null);
// marker.pointArr.push(point);
marker.on("moveend", (e) => {
// this.addDevice(carPathData,carBackComponent);
// 如果不是最后一个点,就创建一个新的worderpoint,如果是就不创建,并且把自身删除
let z = {
longitude: e.pos[0],
latitude: e.pos[1],
iconType: 14,
time: times[e.index],
};
// 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);
});
marker.moveAlong(path, {
// 每一段的时长 // 每一段的时长
duration: 8000,//可根据实际采集时间间隔设置 duration: 8000, //可根据实际采集时间间隔设置
// JSAPI2.0 是否延道路自动设置角度在 moveAlong 里设置 // JSAPI2.0 是否延道路自动设置角度在 moveAlong 里设置
autoRotation: true, autoRotation: true,
}); });
}); });
} }
clearbackTrack(vehicleId) { clearbackTrack(vehicleId) {
// let marker = this.allDevice[9].filter( // let marker = this.allDevice[9].filter(
// (item) => item.getExtData().vehicleId == vehicleId // (item) => item.getExtData().vehicleId == vehicleId
// )[0]; // )[0];
this.allDevice["9"]?.forEach(item=>{ this.allDevice["9"]?.forEach((item) => {
if (item) { if (item) {
// 停止运动 // 停止运动
item.stopMove(); item.stopMove();
if(item.polyline){ // 删除每个点
console.log(item.pointArr);
if (item.polyline) {
this.map.remove(item.polyline); this.map.remove(item.polyline);
} }
if(item.passedPolyline){ if (item.passedPolyline) {
this.map.remove(item.passedPolyline); this.map.remove(item.passedPolyline);
} }
this.map.remove(item); this.map.remove(item);
} }
}) });
// 最后把数组清空 // 最后把数组清空
this.allDevice["9"]=[]; this.allDevice["9"] = [];
// 把car的路径点也清空
this.allDevice["14"]?.forEach((iten) => {
this.map.remove(iten);
});
this.allDevice["14"] = [];
this.infowindowClose(); 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