mapbox-gl-draw-modes-modify

这是一个mapbox-gl-draw的绘图模式个性化修改器。在原有模式上增添了许多方便实用的功能。
This is a mapbox-gl-draw drawing modes personalization modifier. Many convenient and practical functions have been added to the original model.
Run Simple Demo
$ git clone https://github.com/SuperYesifang/mapbox-gl-draw-modes-modify.git
$ cd mapbox-gl-draw-modes-modify
$ npm run serve
Usage
DrawModesModify(MapboxDraw.modes, options?)
1. Use CDN
<script src="https://raw.githubusercontent.com/SuperYesifang/mapbox-gl-draw-modes-modify/master/dist/DrawModesModify.cdn.js"></script>
2. Use ESM
import MapboxDraw from "@mapbox/mapbox-gl-draw";
import DrawModesModify from "mapbox-gl-draw-modes-modify";
const draw = new MapboxDraw({
modes: DrawModesModify(MapboxDraw.modes, {
editable: false
})
});
map.addControl(draw);
Options
editable | boolean | Whether the drawing can be re-edited. default: true . |
selectable | boolean | Whether the drawing you have drawn can be selected. default: true . |
draggable | boolean | Whether the drawing can be dragged and moved. default: true .(valid when editable is ture ) |
adjustable | boolean | Whether the drawn graph can reposition the vertex. defualt : true .(valid when editable is ture ) |
focus | boolean | Whether to retain the focus of the graphic after the drawing is completed. default: true. |