|
|
@ -434,6 +434,11 @@ const OlMap = (props) => { |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (busLine && olMap && tab == 'operation') { |
|
|
|
if (busLine.length) { |
|
|
|
olMap.closeOverlay('clickOpen') |
|
|
|
busRunData.forEach((d, index) => { |
|
|
|
olMap.removeGeometryLayer('geometry_bus_' + index) |
|
|
|
}) |
|
|
|
olMap.addGeometryLayer({ |
|
|
|
features: [ |
|
|
|
{ |
|
|
@ -453,15 +458,11 @@ const OlMap = (props) => { |
|
|
|
selectStyle: { stroke: { width: 8, color: '#9933FF' } }, |
|
|
|
layerName: 'geometry_bus_line' |
|
|
|
}); |
|
|
|
if (busLine.length) { |
|
|
|
olMap.closeOverlay('clickOpen') |
|
|
|
olMap.setCenter([ |
|
|
|
(busLine[0].pointLng + busLine[busLine.length - 1].pointLng) / 2, |
|
|
|
(busLine[0].pointLat + busLine[busLine.length - 1].pointLat) / 2 |
|
|
|
]) |
|
|
|
busRunData.forEach((d, index) => { |
|
|
|
olMap.removeGeometryLayer('geometry_bus_' + index) |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
drawBusRunPoint() |
|
|
|
} |
|
|
|