Mapbox GL Draw Cut Line Mode
This is a custom mode for Mapbox GL Draw 1.x that adds the LineString cutting/splitting functionality
yarn add mapbox-gl-draw-cut-line-mode
;const modes = MapboxDrawmodes;modescut_line = CutLineMode;const draw =modes: modes;draw;
Once a feature is splitted, 2 events are fired:
draw.deletewith the id of the deleted feature
draw.createwith the new (children) features
See a full example in the example folder.
yarn build will do it.