一个自定义mode,是对官方插件mapbox-gl-draw.js的一个补充,它实现了绘制椭圆的能力
yarn add mapbox-gl-draw-ellipse
todo
import DrawEllipse from 'mapbox-gl-draw-ellipse';
const modes = MapboxDraw.modes;
modes.draw_ellipse = DrawEllipse;
const draw = new MapboxDraw({ modes });
draw.changeMode('draw_ellipse', { eccentricity: 0.8, divisions: 60 });
yarn build
will do it.
MIT