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;