Browse Source

관제 공역 3d화 테스트

pull/2/head
김장현 1 year ago
parent
commit
6e495befef
  1. 47
      src/components/map/mapbox/MapBoxMap.js

47
src/components/map/mapbox/MapBoxMap.js

@ -325,24 +325,24 @@ export default function MapBoxMap() {
// }); // });
// 지형 3d end // 지형 3d end
// 등고선 start // 등고선 start
map.addLayer({ // map.addLayer({
id: 'contours', // id: 'contours',
type: 'line', // type: 'line',
source: { // source: {
type: 'vector', // type: 'vector',
url: 'mapbox://mapbox.mapbox-terrain-v2' // url: 'mapbox://mapbox.mapbox-terrain-v2'
}, // },
'source-layer': 'contour', // 'source-layer': 'contour',
layout: { // layout: {
visibility: 'visible', // visibility: 'visible',
'line-join': 'round', // 'line-join': 'round',
'line-cap': 'round' // 'line-cap': 'round'
}, // },
paint: { // paint: {
'line-color': '#877b59', // 'line-color': '#877b59',
'line-width': 1 // 'line-width': 1
} // }
}); // });
// 등고선 end // 등고선 end
// 3d building // 3d building
map.addLayer( map.addLayer(
@ -437,7 +437,9 @@ export default function MapBoxMap() {
}); });
} }
}); });
useGeoJson.features = arrGeoJson; useGeoJson.features = arrGeoJson.filter(
i => i.geometry.type === 'Polygon'
);
// 공역 생성 start // 공역 생성 start
map.addSource('maine', { map.addSource('maine', {
@ -448,12 +450,13 @@ export default function MapBoxMap() {
}); });
map.addLayer({ map.addLayer({
id: 'maine', id: 'maine',
type: 'fill', type: 'fill-extrusion',
source: 'maine', source: 'maine',
layout: {}, layout: {},
paint: { paint: {
'fill-color': ['get', 'color'], 'fill-extrusion-color': ['get', 'color'],
'fill-opacity': 0.5 'fill-extrusion-height': 3000,
'fill-extrusion-opacity': 0.5
} }
}); });
// 공역 생성 end // 공역 생성 end

Loading…
Cancel
Save