diff --git a/src/store/utils/getGeoJSON.ts b/src/store/utils/getGeoJSON.ts index fa558de..91076ee 100644 --- a/src/store/utils/getGeoJSON.ts +++ b/src/store/utils/getGeoJSON.ts @@ -31,7 +31,7 @@ export function getGeoJSON(state: IMapOptions): GeoJSON.FeatureCollection { properties.water = true; } - coordinates.forEach((shape) => { + coordinates = coordinates.map((shape) => { if (turf.booleanClockwise(shape)) { shape = shape.reverse(); } @@ -43,6 +43,7 @@ export function getGeoJSON(state: IMapOptions): GeoJSON.FeatureCollection { shape.push([...shape[0]]); } } + return shape; }); features.push({ type: "Feature",