1.2.2 • Published 2 years ago

@ookla/mapbox-gl-draw-rectangle v1.2.2

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

Mapbox GL Draw Rectangle Mode

A custom mode for MapboxGL Draw to draw rectangles that adds the functionality of keeping the rectangle's shape when adjusting a corner of the drawn rectangles. This mode is compatible with @mapbox/mapbox-gl-draw@1.4.0 and above. Original inspiration comes from this package, which hasn't been mantained for the last 4 years: https://github.com/thegisdev/mapbox-gl-draw-rectangle-mode

Usage

import DrawRectangle from 'mapbox-gl-draw-rectangle-mode';

const modes = MapboxDraw.modes;
modes.draw_rectangle = DrawRectangle;

const draw = new MapboxDraw({
  modes: modes
});

draw.changeMode('draw_rectangle');

Once a rectangle is created, 1 event is fired:

  • draw.create with the created rectangle

Build

yarn build will do it.

License

MIT

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

1.0.1

2 years ago