From 6d98ab1e5a260aad06dda57ada2d04e6807da7f8 Mon Sep 17 00:00:00 2001 From: JANGHYUNn Date: Tue, 3 Sep 2024 08:23:52 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9A=B8=EC=82=B0,=20=EC=A0=9C=EC=A3=BC=20?= =?UTF-8?q?=EA=B3=B5=EC=97=AD=20=EC=A4=91=EB=B3=B5=20=EC=95=84=EC=9D=B4?= =?UTF-8?q?=EB=94=94=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/map/mapbox/MapBoxMap.js | 19 ++++++++++--------- src/utility/hooks/useMapType.ts | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/map/mapbox/MapBoxMap.js b/src/components/map/mapbox/MapBoxMap.js index a478c681..3aa3ac5b 100644 --- a/src/components/map/mapbox/MapBoxMap.js +++ b/src/components/map/mapbox/MapBoxMap.js @@ -530,22 +530,23 @@ export default function MapBoxMap({ handlerDrawObjInit }) { } }); } else { + console.log('@?@?'); map.setTerrain(); map.setMaxPitch(0); map.setBearing(0); map.dragRotate.disable(); // 김포 gimPo.features.map((i, idx) => { - map.addSource(`lineRoute${idx}`, { + map.addSource(`lineRoute_gimpo${idx}`, { type: 'geojson', data: { ...i } }); map.addLayer({ - id: `lineRoute${idx}`, + id: `lineRoute_gimpo${idx}`, type: 'line', - source: `lineRoute${idx}`, + source: `lineRoute_gimpo${idx}`, layout: { 'line-join': 'round', 'line-cap': 'round' @@ -558,16 +559,16 @@ export default function MapBoxMap({ handlerDrawObjInit }) { }); // 울산 ulsan.features.map((i, idx) => { - map.addSource(`lineRoute${idx}`, { + map.addSource(`lineRoute_ulsan${idx}`, { type: 'geojson', data: { ...i } }); map.addLayer({ - id: `lineRoute${idx}`, + id: `lineRoute_ulsan${idx}`, type: 'line', - source: `lineRoute${idx}`, + source: `lineRoute_ulsan${idx}`, layout: { 'line-join': 'round', 'line-cap': 'round' @@ -580,16 +581,16 @@ export default function MapBoxMap({ handlerDrawObjInit }) { }); // 제주 jeju.features.map((i, idx) => { - map.addSource(`lineRoute${idx}`, { + map.addSource(`lineRoute_jeju${idx}`, { type: 'geojson', data: { ...i } }); map.addLayer({ - id: `lineRoute${idx}`, + id: `lineRoute_jeju${idx}`, type: 'line', - source: `lineRoute${idx}`, + source: `lineRoute_jeju${idx}`, layout: { 'line-join': 'round', 'line-cap': 'round' diff --git a/src/utility/hooks/useMapType.ts b/src/utility/hooks/useMapType.ts index cf2b85c7..520cbcb8 100644 --- a/src/utility/hooks/useMapType.ts +++ b/src/utility/hooks/useMapType.ts @@ -4,7 +4,7 @@ import { clientMapTypeChange } from '@src/redux/features/control/map/mapSlice'; type mapType = 'TERRAIN' | 'NORMAL' | '2D' | 'SATELLITE'; -const useMapType = () => { +function useMapType() { const [mapType, setMapType] = useState('TERRAIN'); const dispatch = useDispatch(); // 지도, 지도타입, 공역 타입 컨트롤 @@ -21,6 +21,6 @@ const useMapType = () => { }; return [handlerMapType]; -}; +} export default useMapType;