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