Commit 8adda220 authored by 耿迪迪's avatar 耿迪迪
parents 50110ca2 82a15259
This diff is collapsed.
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-01-11 13:45:12 * @Date: 2022-01-11 13:45:12
* @LastEditTime: 2026-04-16 15:38:02 * @LastEditTime: 2026-07-15 15:55:04
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @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
...@@ -819,6 +819,7 @@ export class EditorMap { ...@@ -819,6 +819,7 @@ export class EditorMap {
hfLine = null; hfLine = null;
hfLine2 = null; hfLine2 = null;
huifang(path) { huifang(path) {
if(path.length<1) return;
AMap.plugin("AMap.MoveAnimation", () => { AMap.plugin("AMap.MoveAnimation", () => {
var marker, var marker,
lineArr = path; lineArr = path;
...@@ -868,6 +869,7 @@ export class EditorMap { ...@@ -868,6 +869,7 @@ export class EditorMap {
} }
clearhf() { clearhf() {
if (this.hfMarker || this.hfLine || this.hfLine2) { if (this.hfMarker || this.hfLine || this.hfLine2) {
this.hfMarker.stopMove();
this.map.remove(this.hfMarker); this.map.remove(this.hfMarker);
this.map.remove(this.hfLine); this.map.remove(this.hfLine);
this.map.remove(this.hfLine2); this.map.remove(this.hfLine2);
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-01-11 13:45:12 * @Date: 2022-01-11 13:45:12
* @LastEditTime: 2023-10-13 15:32:17 * @LastEditTime: 2026-07-15 11:31:09
* @LastEditors: 纪泽龙 jizelong@qq.com * @LastEditors: 纪泽龙 jizelong@qq.com
* @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
*/ */
// import { pipeColor, svgUrl, svgAlarm } from "@/utils/mapClass/config.js"; // import { pipeColor, svgUrl, svgAlarm } from "@/utils/mapClass/config.js";
// 编辑类 // 编辑类
// 在地图上新增的设备可以直接编辑, // 在地图上新增的设备可以直接编辑,
// 已经保存完成的设备需要点编辑才可以编辑 // 已经保存完成的设备需要点编辑才可以编辑
import { townsData } from "./xiangzhen";
export class EditorMap { export class EditorMap {
// 地图的对象实例 // 地图的对象实例
map = null; map = null;
...@@ -34,7 +35,7 @@ export class EditorMap { ...@@ -34,7 +35,7 @@ export class EditorMap {
mouseToolPolineOptions = null; mouseToolPolineOptions = null;
// 存放设备图标的对象,需要new的时候传进来 // 存放设备图标的对象,需要new的时候传进来
devicePicData = {}; devicePicData = {};
pipeColor={}; pipeColor = {};
// 存放所有的设备的数组集合,这是一个对象,对象里面是各种设备的数组 // 存放所有的设备的数组集合,这是一个对象,对象里面是各种设备的数组
allDevice = {}; allDevice = {};
// 存放所有的管道 // 存放所有的管道
...@@ -87,6 +88,7 @@ export class EditorMap { ...@@ -87,6 +88,7 @@ export class EditorMap {
this.mouseAddDevice(); this.mouseAddDevice();
// this.mouseAddMarker(); // this.mouseAddMarker();
// this.mouseAddPipeline(); // this.mouseAddPipeline();
this.frbj();
// 地图边界 // 地图边界
this.map.getCity((res) => { this.map.getCity((res) => {
const district = res.district; const district = res.district;
...@@ -121,15 +123,26 @@ export class EditorMap { ...@@ -121,15 +123,26 @@ export class EditorMap {
// fillColor: "transparent", // fillColor: "transparent",
// strokeColor: "#09f", // strokeColor: "#09f",
// }); // });
// new AMap.Polyline({
// map: this.map,
// strokeWeight: 4,
// strokeColor: "#09f",
// path: bounds[i],
// });
// polygons.push(polygon);
}
}
});
}
frbj() {
townsData.forEach((item) => {
console.log(item);
new AMap.Polyline({ new AMap.Polyline({
map: this.map, map: this.map,
strokeWeight: 4, strokeWeight: 4,
strokeColor: "#09f", strokeColor: "#09f",
path: bounds[i], path: item.lnglat,
}); });
// polygons.push(polygon);
}
}
}); });
} }
// map的事件监听 // map的事件监听
...@@ -341,7 +354,11 @@ export class EditorMap { ...@@ -341,7 +354,11 @@ export class EditorMap {
position: [lng, lat], position: [lng, lat],
extData: deviceData, extData: deviceData,
label: { label: {
content: deviceData.siteStationName || deviceData.titlename || deviceData.deviceName || '设备', content:
deviceData.siteStationName ||
deviceData.titlename ||
deviceData.deviceName ||
"设备",
direction: "top", direction: "top",
}, },
}); });
...@@ -473,13 +490,13 @@ export class EditorMap { ...@@ -473,13 +490,13 @@ export class EditorMap {
path: eval(path), path: eval(path),
strokeWeight: objData.strokeWeight || 4, strokeWeight: objData.strokeWeight || 4,
strokeColor: color, strokeColor: color,
strokeOpacity: pipePressure==5?1:0.6, strokeOpacity: pipePressure == 5 ? 1 : 0.6,
extData: objData, extData: objData,
cursor: "pointer", cursor: "pointer",
zIndex: pipePressure==5?20:10 zIndex: pipePressure == 5 ? 20 : 10,
}); });
if(objData.ishidden==1){ if (objData.ishidden == 1) {
pipe.hide(); pipe.hide();
} }
...@@ -488,9 +505,9 @@ export class EditorMap { ...@@ -488,9 +505,9 @@ export class EditorMap {
// if (!Array.isArray(this.pipeArr[iconType])) { // if (!Array.isArray(this.pipeArr[iconType])) {
// this.pipeArr[iconType] = []; // this.pipeArr[iconType] = [];
// } // }
if(pipePressure==5){ if (pipePressure == 5) {
this.pipeArr2.push(pipe); this.pipeArr2.push(pipe);
}else{ } else {
this.pipeArr.push(pipe); this.pipeArr.push(pipe);
this.pipeEvent(pipe, component); this.pipeEvent(pipe, component);
} }
...@@ -580,8 +597,8 @@ export class EditorMap { ...@@ -580,8 +597,8 @@ export class EditorMap {
pipefilter(ind, type) { pipefilter(ind, type) {
this.pipeArr.forEach((pipe) => { this.pipeArr.forEach((pipe) => {
const data = pipe.getExtData(); const data = pipe.getExtData();
if(type == data.pipePressure-1){ if (type == data.pipePressure - 1) {
if (ind>=0){ if (ind >= 0) {
pipe.hide(); pipe.hide();
} else { } else {
pipe.show(); pipe.show();
...@@ -591,8 +608,8 @@ export class EditorMap { ...@@ -591,8 +608,8 @@ export class EditorMap {
this.pipeArr2.forEach((pipe) => { this.pipeArr2.forEach((pipe) => {
const data = pipe.getExtData(); const data = pipe.getExtData();
if(type == data.pipeType-1){ if (type == data.pipeType - 1) {
if (ind>=0){ if (ind >= 0) {
pipe.hide(); pipe.hide();
} else { } else {
pipe.show(); pipe.show();
...@@ -604,7 +621,7 @@ export class EditorMap { ...@@ -604,7 +621,7 @@ export class EditorMap {
/** /**
* 清除管线 * 清除管线
*/ */
clearPipe(){ clearPipe() {
this.map.remove(this.pipeArrold); this.map.remove(this.pipeArrold);
} }
...@@ -893,7 +910,6 @@ export class EditorMap { ...@@ -893,7 +910,6 @@ export class EditorMap {
this.map.destroy(); this.map.destroy();
} }
/** /**
* 地图上添加场站 海量标注 LabelMarker 方式 * 地图上添加场站 海量标注 LabelMarker 方式
* @param {*} detectorUserData * @param {*} detectorUserData
...@@ -1107,11 +1123,7 @@ export class EditorMap { ...@@ -1107,11 +1123,7 @@ export class EditorMap {
* @param {*} component * @param {*} component
* @param {*} showBool * @param {*} showBool
*/ */
labelsLayerMarksDetectorUserList( labelsLayerMarksDetectorUserList(mapData, compontent, showBool = true) {
mapData,
compontent,
showBool = true
) {
if (mapData != null) { if (mapData != null) {
const hashMap = new Map(); const hashMap = new Map();
this.businessDetectorUserlabelsLayer = new AMap.LabelsLayer({ this.businessDetectorUserlabelsLayer = new AMap.LabelsLayer({
......
This diff is collapsed.
...@@ -156,6 +156,7 @@ export default { ...@@ -156,6 +156,7 @@ export default {
}, },
/**获取历史轨迹*/ /**获取历史轨迹*/
getTrackHistory(query) { getTrackHistory(query) {
this.historyTrack=null;
historyTrack(query).then((res) => { historyTrack(query).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data.devices) { if (res.data.devices) {
......
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