Skip to content

Commit

Permalink
Add MultiPolygon support to MapDraw (#311)
Browse files Browse the repository at this point in the history
* add MultiPolygon support to MapDraw

* more efficient place to define array

* null check onGeocodingSelection

* actually let's do another PR for that
  • Loading branch information
camdendotlol authored Jan 6, 2025
1 parent c923573 commit a9f15f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/geospatial/src/components/MapDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const DEFAULT_ZOOM_DELAY = 1000;
const GeometryTypes = {
geometryCollection: 'GeometryCollection',
point: 'Point',
polygon: 'Polygon'
polygon: ['Polygon', 'MultiPolygon']
};

/**
Expand Down Expand Up @@ -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]);

/**
Expand Down

0 comments on commit a9f15f5

Please sign in to comment.