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

本地中压管线上图

parent 9c68523f
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -39,6 +39,7 @@ import {
deviceIcon,
pipeColor,
} from "@/utils/mapClass/deviceIconTypeConfig";
import axios from "axios";
export default {
name: "",
......@@ -111,6 +112,8 @@ export default {
});
}
});
//加载本地管线
this.getLocationPipe();
},
getPointList(){
......@@ -233,6 +236,25 @@ export default {
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