Browse Source

approvals edit

master
sanguu516 6 months ago
parent
commit
1ed1227ded
  1. 24
      src/containers/flight/flightApprovalsContainer.js

24
src/containers/flight/flightApprovalsContainer.js

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

Loading…
Cancel
Save