@polar/plugin-draw
Version:
Draw plugin for POLAR that adds draw interactions to the map, allowing users to place various shapes and texts.
10 lines (8 loc) • 381 B
text/typescript
import { FeatureCollection } from 'geojson'
import { GeometryType } from '../../types'
// FeatureCollection is compatible to stupid clone
export const cloneFeatureCollection = (
// No GeometryCollection from Draw, hence the <GeometryType>
featureCollection: FeatureCollection<GeometryType>
): FeatureCollection<GeometryType> =>
JSON.parse(JSON.stringify(featureCollection))