Browse Source

울산, 제주 공역 중복 아이디 수정

master
김장현 2 weeks ago
parent
commit
6d98ab1e5a
  1. 19
      src/components/map/mapbox/MapBoxMap.js
  2. 4
      src/utility/hooks/useMapType.ts

19
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'

4
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<mapType>('TERRAIN');
const dispatch = useDispatch();
// 지도, 지도타입, 공역 타입 컨트롤
@ -21,6 +21,6 @@ const useMapType = () => {
};
return [handlerMapType];
};
}
export default useMapType;

Loading…
Cancel
Save