Browse Source

코드 간략화

master
junh_eee(이준희) 9 months ago
parent
commit
8591670fa0
  1. 12
      src/components/map/mapbox/feature/FeatureAirZone.js

12
src/components/map/mapbox/feature/FeatureAirZone.js

@ -354,11 +354,7 @@ export const FeatureAirZone = props => {
// [경도, 위도] -> [{x: 경도, y: 위도}] 포맷팅 // [경도, 위도] -> [{x: 경도, y: 위도}] 포맷팅
const routeLine = routeFeatures const routeLine = routeFeatures
.filter(route => route.geometry.type === 'LineString') .filter(route => route.geometry.type === 'LineString')
.map(line => { .map(line => line.geometry.coordinates.map(([x, y]) => ({ x, y })));
return line.geometry.coordinates.map(p => {
return { x: p[0], y: p[1] };
});
});
// uam노선 버퍼 좌표 요청 // uam노선 버퍼 좌표 요청
const bufferCreate = async coords => { const bufferCreate = async coords => {
@ -370,11 +366,7 @@ export const FeatureAirZone = props => {
} }
); );
const paths = []; const paths = bufferList.map(buffer => [buffer.x, buffer.y]);
bufferList.map(buffer => {
const path = [buffer.x, buffer.y];
paths.push(path);
});
const bufferObj = { const bufferObj = {
type: 'Feature', type: 'Feature',
geometry: { geometry: {

Loading…
Cancel
Save