mapbox-gl-draw-bezier-curve-mode
Version:
A custom mode for MapboxGL-Draw to draw and edit bezier curves.
19 lines (18 loc) • 558 B
JavaScript
import * as Constants from '@mapbox/mapbox-gl-draw/src/constants';
export default function createBezierHandle(parentId, coordinates, path, selected) {
return {
type: Constants.geojsonTypes.FEATURE,
properties: {
meta: Constants.meta.VERTEX,
meta2:"handle",
parent: parentId,
coord_path: path,
bezierHandle: true,
active: (selected) ? Constants.activeStates.ACTIVE : Constants.activeStates.INACTIVE
},
geometry: {
type: Constants.geojsonTypes.POINT,
coordinates
}
};
}