|
|
@ -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, |
|
|
|