From 6e495befefb21eaff10729ea519f983ce0e1d536 Mon Sep 17 00:00:00 2001 From: JANGHYUNn Date: Thu, 7 Sep 2023 18:51:23 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B4=80=EC=A0=9C=20=EA=B3=B5=EC=97=AD=203d?= =?UTF-8?q?=ED=99=94=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/map/mapbox/MapBoxMap.js | 47 ++++++++++++++------------ 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/src/components/map/mapbox/MapBoxMap.js b/src/components/map/mapbox/MapBoxMap.js index a7e719e..3c5b00a 100644 --- a/src/components/map/mapbox/MapBoxMap.js +++ b/src/components/map/mapbox/MapBoxMap.js @@ -325,24 +325,24 @@ export default function MapBoxMap() { // }); // 지형 3d end // 등고선 start - map.addLayer({ - id: 'contours', - type: 'line', - source: { - type: 'vector', - url: 'mapbox://mapbox.mapbox-terrain-v2' - }, - 'source-layer': 'contour', - layout: { - visibility: 'visible', - 'line-join': 'round', - 'line-cap': 'round' - }, - paint: { - 'line-color': '#877b59', - 'line-width': 1 - } - }); + // map.addLayer({ + // id: 'contours', + // type: 'line', + // source: { + // type: 'vector', + // url: 'mapbox://mapbox.mapbox-terrain-v2' + // }, + // 'source-layer': 'contour', + // layout: { + // visibility: 'visible', + // 'line-join': 'round', + // 'line-cap': 'round' + // }, + // paint: { + // 'line-color': '#877b59', + // 'line-width': 1 + // } + // }); // 등고선 end // 3d building map.addLayer( @@ -437,7 +437,9 @@ export default function MapBoxMap() { }); } }); - useGeoJson.features = arrGeoJson; + useGeoJson.features = arrGeoJson.filter( + i => i.geometry.type === 'Polygon' + ); // 공역 생성 start map.addSource('maine', { @@ -448,12 +450,13 @@ export default function MapBoxMap() { }); map.addLayer({ id: 'maine', - type: 'fill', + type: 'fill-extrusion', source: 'maine', layout: {}, paint: { - 'fill-color': ['get', 'color'], - 'fill-opacity': 0.5 + 'fill-extrusion-color': ['get', 'color'], + 'fill-extrusion-height': 3000, + 'fill-extrusion-opacity': 0.5 } }); // 공역 생성 end