mapbox-gl-draw-rectangle-mode-cdn
v1.0.0
Published
这是mapbox-gl-draw-rectangle-mode的cdn支持版本
Downloads
2
Maintainers
Readme
mapbox-gl-draw-rectangle-mode-cdn
这是一个mapbox-gl-draw-rectangle-mode的cdn支持版本。
This is a cdn-supported version of mapbox-gl-draw-rectangle-mode.
Run Simple Demo
$ git clone https://github.com/SuperYesifang/mapbox-gl-draw-rectangle-mode-cdn.git
$ cd mapbox-gl-draw-rectangle-mode-cdn
$ npm run serve
Usage
1. Use CDN
<script src="https://raw.githubusercontent.com/SuperYesifang/mapbox-gl-draw-rectangle-mode-cdn/master/dist/DrawRectangleMode.cdn.js"></script>
<script>
console.log(DrawRectangleMode);
</script>
2. Use ESM
import MapboxDraw from "@mapbox/mapbox-gl-draw";
import DrawRectangleMode from "mapbox-gl-draw-rectangle-mode-cdn";
const draw = new MapboxDraw({
modes: {
...MapboxDraw.modes,
draw_rectangle: DrawRectangleMode
}
});
map.addControl(draw);