From 9bdfe9881a23000adf32054338ffc83425e6ca9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?junh=5Feee=28=EC=9D=B4=EC=A4=80=ED=9D=AC=29?= Date: Thu, 14 Dec 2023 16:57:02 +0900 Subject: [PATCH] =?UTF-8?q?=EB=93=9C=EB=A1=A0=EA=B5=90=ED=86=B5=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EC=86=A1=EC=A0=84=ED=83=91=20=EB=A7=88=EC=BB=A4=20?= =?UTF-8?q?=ED=91=9C=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../map/mapbox/feature/FeatureAirZone.js | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/components/map/mapbox/feature/FeatureAirZone.js b/src/components/map/mapbox/feature/FeatureAirZone.js index 478ca0a..5be4ca1 100644 --- a/src/components/map/mapbox/feature/FeatureAirZone.js +++ b/src/components/map/mapbox/feature/FeatureAirZone.js @@ -366,7 +366,10 @@ export const FeatureAirZone = props => { // uam 셋팅 함수 const uamAirAreaInit = () => { if (number === 0) { + // uam노선 features const routeFeatures = uamRouteArea.features; + + // [경도, 위도] -> [{x: 경도, y: 위도}] 포맷팅 const routeLine = routeFeatures .filter(route => route.geometry.type === 'LineString') .map(line => { @@ -385,6 +388,29 @@ export const FeatureAirZone = props => { ); }); + // 송전선 features + const towerFeatures = uamTowerArea.features; + + // 송전탑 마커 생성 + towerFeatures + .filter(tower => tower.properties.type === 'towerPoint') + .map((point, idx) => { + const el = document.createElement('img'); + el.id = `tower${idx}`; + el.src = towerImg; + el.style.width = '20px'; + el.style.height = '20px'; + + new props.mapboxgl.Marker({ + element: el + }) + .setLngLat( + props.mapboxgl.LngLat.convert(point.geometry.coordinates) + ) + .addTo(props.map); + }); + + // uam 관련 Source, Layer props.map.addSource('uam', { type: 'geojson', data: uamGeoJson @@ -441,8 +467,7 @@ export const FeatureAirZone = props => { }, paint: { 'line-color': '#960018', - 'line-width': 1, - 'line-dasharray': [5, 5] + 'line-width': 1 }, filter: ['==', ['get', 'type'], 'towerLine'] });