mapbox-gl-draw-bezier-curve-mode
Version:
A custom mode for MapboxGL-Draw to draw and edit bezier curves.
20 lines (19 loc) • 581 B
JavaScript
import MapboxDraw from '@mapbox/mapbox-gl-draw';
const Constants = MapboxDraw.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
}
};
}