Skip to content

Commit

Permalink
CDC #248 - Adding "preserveDrawingBuffer" prop to MapDraw component
Browse files Browse the repository at this point in the history
  • Loading branch information
dleadbetter committed Jul 23, 2024
1 parent 7a18df1 commit 4028a4f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/geospatial/src/components/MapDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ type Props = {
*/
onGeocodingSelection?: (data: any) => void,

/**
* If `true`, the map's canvas can be exported to a PNG using `map.getCanvas().toDataURL()`.
*/
preserveDrawingBuffer?: boolean,

/**
* Map style object.
*/
Expand Down Expand Up @@ -197,8 +202,9 @@ const MapDraw = (props: Props) => {
<Map
attributionControl={false}
cooperativeGestures={props.cooperativeGestures}
onLoad={() => setLoaded(true)}
mapLib={maplibregl}
onLoad={() => setLoaded(true)}
preserveDrawingBuffer={props.preserveDrawingBuffer}
ref={mapRef}
style={style}
mapStyle={mapStyleUrl}
Expand Down Expand Up @@ -241,6 +247,7 @@ const MapDraw = (props: Props) => {
MapDraw.defaultProps = {
buffer: DEFAULT_BUFFER,
cooperativeGestures: true,
preserveDrawingBuffer: false,
zoomDuration: DEFAULT_ZOOM_DELAY
};

Expand Down

0 comments on commit 4028a4f

Please sign in to comment.