Commit ac4f58dd authored by 耿迪迪's avatar 耿迪迪

本地中压管线上图

parent 9c68523f
This diff is collapsed.
...@@ -39,6 +39,7 @@ import { ...@@ -39,6 +39,7 @@ import {
deviceIcon, deviceIcon,
pipeColor, pipeColor,
} from "@/utils/mapClass/deviceIconTypeConfig"; } from "@/utils/mapClass/deviceIconTypeConfig";
import axios from "axios";
export default { export default {
name: "", name: "",
...@@ -102,15 +103,17 @@ export default { ...@@ -102,15 +103,17 @@ export default {
getpipe(){ getpipe(){
pipeInfoList().then((res) => { pipeInfoList().then((res) => {
if (res.code == 200 && res.data) { if (res.code == 200 && res.data) {
res.data.forEach((item) => { res.data.forEach((item) => {
item.path = eval(item.coordinates); item.path = eval(item.coordinates);
item.pipePressure = item.pipeType; item.pipePressure = item.pipeType;
item.strokeWeight = 4; item.strokeWeight = 4;
this.gaoMap.addPipeLine(item, PipeInfo); this.gaoMap.addPipeLine(item, PipeInfo);
});
}
}); });
} //加载本地管线
}); this.getLocationPipe();
}, },
getPointList(){ getPointList(){
...@@ -233,6 +236,25 @@ export default { ...@@ -233,6 +236,25 @@ export default {
this.gaoMap.businessDetectorUserlabelsLayer.show(); this.gaoMap.businessDetectorUserlabelsLayer.show();
} }
} }
},
getLocationPipe(){
axios.get("../geo_json/pipe.json").then((res) => {
if(res.data){
//let lines = res.data.split(/\r?\n|\r/);
res.data.forEach((line, index) => {
let locations = line.coordinates.split(";");
let pipe = [];
locations.forEach(location => {
pipe.push(location.split(","));
})
line.path = eval(pipe);
line.pipeLength = parseFloat(line.pipeLength).toFixed(2);
line.pipePressure = 3;
line.strokeWeight = 4;
this.gaoMap.addPipeLine(line, PipeInfo);
});
}
})
} }
}, },
}; };
......
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