1.0.2 • Published 2 years ago

mapbox-gl-draw-modes-modify v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

mapbox-gl-draw-modes-modify

mapbox-gl-draw-modes-modify nodejs blog

这是一个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

proptypedescription
editablebooleanWhether the drawing can be re-edited. default: true.
selectablebooleanWhether the drawing you have drawn can be selected. default: true.
draggablebooleanWhether the drawing can be dragged and moved. default: true.(valid when editable is ture)
adjustablebooleanWhether the drawn graph can reposition the vertex. defualt : true.(valid when editable is ture)
focusbooleanWhether to retain the focus of the graphic after the drawing is completed. default: true.