|
|
|
@ -217,16 +217,22 @@ export default function FlightApprovalsContainer() {
|
|
|
|
|
} |
|
|
|
|
}, [map]); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (mapObject) { |
|
|
|
|
console.log('>>>', mapObject.getSource('preview')); |
|
|
|
|
} |
|
|
|
|
}, [mapObject]); |
|
|
|
|
|
|
|
|
|
const handlerMapInit = () => { |
|
|
|
|
map.on('style.load', () => { |
|
|
|
|
map.addSource('preview', { |
|
|
|
|
mapObject.on('style.load', () => { |
|
|
|
|
mapObject.addSource('preview', { |
|
|
|
|
type: 'geojson', |
|
|
|
|
data: previewGeo2 |
|
|
|
|
}); |
|
|
|
|
map.addLayer(layerPolyline('preview')); |
|
|
|
|
map.addLayer(layerPolygon('preview')); |
|
|
|
|
map.addLayer(layerBuffer('preview')); |
|
|
|
|
map.addLayer(layerWayPoint('preview')); |
|
|
|
|
mapObject.addLayer(layerPolyline('preview')); |
|
|
|
|
mapObject.addLayer(layerPolygon('preview')); |
|
|
|
|
mapObject.addLayer(layerBuffer('preview')); |
|
|
|
|
mapObject.addLayer(layerWayPoint('preview')); |
|
|
|
|
|
|
|
|
|
setDrawObj(draw); |
|
|
|
|
map.dragRotate.disable(); |
|
|
|
@ -269,7 +275,7 @@ export default function FlightApprovalsContainer() {
|
|
|
|
|
const point = []; |
|
|
|
|
if (areas.areaType === 'LINE') { |
|
|
|
|
lineString.geometry.coordinates = paths; |
|
|
|
|
previewGeo2features.push(lineString); |
|
|
|
|
previewGeo2.features.push(lineString); |
|
|
|
|
|
|
|
|
|
//버퍼 생성
|
|
|
|
|
if (areas.bufferCoordList) { |
|
|
|
@ -291,10 +297,10 @@ export default function FlightApprovalsContainer() {
|
|
|
|
|
const wayPoint = handlerCreatePoint(p, i, areas.areaType); |
|
|
|
|
point.push(wayPoint); |
|
|
|
|
}); |
|
|
|
|
previewGeo2features = previewGeo2features.filter( |
|
|
|
|
previewGeo2.features = previewGeo2.features.filter( |
|
|
|
|
geo => geo.properties.id !== 'point' |
|
|
|
|
); |
|
|
|
|
point.forEach(p => previewGeo2features.push(p)); |
|
|
|
|
point.forEach(p => previewGeo2.features.push(p)); |
|
|
|
|
|
|
|
|
|
//지도 줌 좌표 설정
|
|
|
|
|
fitZoomPaths = paths.concat(); |
|
|
|
|