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