# mapbox-gl-draw-rectangle-mode

> A custom mode for MapboxGL Draw to draw rectangles

Latest version **1.0.4** (published 2018-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install mapbox-gl-draw-rectangle-mode
pnpm add mapbox-gl-draw-rectangle-mode
yarn add mapbox-gl-draw-rectangle-mode
bun add mapbox-gl-draw-rectangle-mode
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2018-12-17 |
| First published | 2018-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 70.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 54 |
| Author | Erick Otenyo |
| Maintainers | erick-otenyo |

## Links

- npm: https://www.npmjs.com/package/mapbox-gl-draw-rectangle-mode
- Repository: https://github.com/edgespatial/mapbox-gl-draw-rectangle-mode
- Homepage: https://github.com/edgespatial/mapbox-gl-draw-rectangle-mode#readme
- Issues: https://github.com/edgespatial/mapbox-gl-draw-rectangle-mode/issues
- npm.io page: https://npm.io/package/mapbox-gl-draw-rectangle-mode

## Recent versions

- 1.0.4 (latest) — 2018-12-17
- 1.0.3 — 2018-03-10
- 1.0.2 — 2018-03-10
- 1.0.1 — 2018-02-25

## README

## Mapbox GL Draw Rectangle Mode

This is a custom mode for Mapbox GL Draw  that adds the functionality to draw rectangles

### Install

`yarn add mapbox-gl-draw-rectangle-mode`

### Demo 

https://bl.ocks.org/andrewharvey/31b8180e3f5f1e12849a352796e0daf4

### Usage

```js
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 events is fired:
- `draw.create` with the created rectangle

### Build

`yarn build` will do it.

### License

MIT

---
_Source: https://npm.io/package/mapbox-gl-draw-rectangle-mode · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
