Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brunosalerno/mapbox-gl-draw-cut-line-mode
This is a custom mode for Mapbox GL Draw 1.x that adds the LineString cutting/splitting functionality
https://github.com/brunosalerno/mapbox-gl-draw-cut-line-mode
Last synced: 1 day ago
JSON representation
This is a custom mode for Mapbox GL Draw 1.x that adds the LineString cutting/splitting functionality
- Host: GitHub
- URL: https://github.com/brunosalerno/mapbox-gl-draw-cut-line-mode
- Owner: BrunoSalerno
- Created: 2017-11-30T23:31:36.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T19:23:35.000Z (almost 2 years ago)
- Last Synced: 2024-11-09T18:08:38.684Z (10 days ago)
- Language: JavaScript
- Size: 1.62 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 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
```js
import CutLineMode from 'mapbox-gl-draw-cut-line-mode';const modes = MapboxDraw.modes;
modes.cut_line = CutLineMode;const draw = new MapboxDraw({
modes: modes
});draw.changeMode('cut_line');
```Once a feature is splitted, 2 events are fired:
- `draw.delete` with the id of the deleted feature
- `draw.create` with the new (children) featuresSee a full example in the [example folder](example/).
### Build
`yarn build` will do it.
### License
MIT