pinning drawing mode for mapbox-gl-draw
npm install mapbox-gl-draw-pinning-mode!npm
Custom mode for Mapbox GL Draw for pinning shared coordinates together during edit.
See a full example in the docs folder, or check at the Demo.
``shell`
npm i mapbox-gl-draw-pinning-mode
or use CDN:
`html`
`jsmapboxGlDrawPinningMode
import mapboxGlDrawPinningMode from "mapbox-gl-draw-pinning-mode";
// or global variable when using script tag
const draw = new MapboxDraw({
modes: {
...MapboxDraw.modes,
pinning_mode: mapboxGlDrawPinningMode,
},
});
// inherited from, and acting similar to simple_select
draw.changeMode("pinning_mode");
`
This mode inherits simple_select mode from the mapbox-gl-draw, so the Behavior is quite the same.
this project is inspired from Pinning` feature of leaflet-geoman (Pro) project.