From a9f15f521b1ccdce4f561360b38850ed8cf69527 Mon Sep 17 00:00:00 2001 From: Camden Date: Mon, 6 Jan 2025 16:19:39 -0500 Subject: [PATCH] Add `MultiPolygon` support to `MapDraw` (#311) * add MultiPolygon support to MapDraw * more efficient place to define array * null check onGeocodingSelection * actually let's do another PR for that --- packages/geospatial/src/components/MapDraw.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/geospatial/src/components/MapDraw.js b/packages/geospatial/src/components/MapDraw.js index 9cdaadcc..7cde8cce 100644 --- a/packages/geospatial/src/components/MapDraw.js +++ b/packages/geospatial/src/components/MapDraw.js @@ -109,7 +109,7 @@ const DEFAULT_ZOOM_DELAY = 1000; const GeometryTypes = { geometryCollection: 'GeometryCollection', point: 'Point', - polygon: 'Polygon' + polygon: ['Polygon', 'MultiPolygon'] }; /** @@ -138,7 +138,7 @@ const MapDraw = (props: Props) => { const { geometry: { type } } = detail; return (props.geocoding === 'point' && type === GeometryTypes.point) - || (props.geocoding === 'polygon' && type === GeometryTypes.polygon); + || (props.geocoding === 'polygon' && GeometryTypes.polygon.includes(type)); }, [props.geocoding]); /**