Browse Source

建设点位根据道路起点

dev
巴林闲侠 1 year ago
parent
commit
f04c791378
  1. 7
      web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js
  2. 21
      web/client/src/sections/quanju/containers/public/olMap.js

7
web/client/src/sections/quanju/containers/footer/leadership/left/echarts/leftbottomecharts.js

@ -17,9 +17,12 @@ const Leftbottomecharts = (props) => {
setCount(res.payload.data.construction.map((item, index) => {
let count = item.count
listData.forEach((s, i) => {
if (s == '2022' && i == index) {
if (s == '2021' && i == index) {
count = 78.7
} else if (s == '2023' && i == index) {
} else if (s == '2022' && i == index) {
// count = 78.7
}
else if (s == '2023' && i == index) {
count = 89.7
}
})

21
web/client/src/sections/quanju/containers/public/olMap.js

@ -497,6 +497,8 @@ const OlMap = (props) => {
let renderIndex = 0
for (let res of roadRes) {
const corData = projectList[renderIndex]
const corProjectRoadReport = roadProjectList.find(d => d.project_name == corData.entryName)
let roadPointPosition = []
if (res) {
if (res.status == 200 && res.body && res.body.code == 1) {
const data = res.body.data
@ -563,13 +565,25 @@ const OlMap = (props) => {
selectStyle: { stroke: { width: 8, color: '#9933FF' } },
layerName: 'geometry_build_road_' + renderIndex
});
//
console.log(olMap, olMap.olLayer)
let feat = olMap.olLayer.geometryLayers['geometry_build_road_' + renderIndex].getSource().getFeatures()
if (feat.length > 0) {
let start = feat[0].getGeometry().getFirstCoordinate()
// let end = feat[feat.length - 1].getGeometry().getLastCoordinate()
console.log(start);
roadPointPosition = start
}
}
}
}
}
if (corData.roadCodeStart) {
if (
roadPointPosition.length
// || corData.roadCodeStart
) {
// 画对应的巡查上报的点
const corProjectRoadReport = roadProjectList.find(d => d.project_name == corData.entryName)
if (corProjectRoadReport) {
const d = corProjectRoadReport
olMap.addGeometryLayer({
@ -587,7 +601,8 @@ const OlMap = (props) => {
olMap.addOverlay('pointClickOpen', {
id: 'pointClickOpen',
offset: [0, 4], // 偏移
position: [d.longitude, d.latitude], // 坐标
// position: [d.longitude, d.latitude], // 坐标
position: roadPointPosition,
// position: [115.944220000000, 28.545380000000],
autoPan: true,
autoPanMargin: 100,

Loading…
Cancel
Save