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