leaflet.draw-box

Leaflet Draw inspired handlers for leaflet.box

Usage no npm install needed!

<script type="module">
  import leafletDrawBox from 'https://cdn.skypack.dev/leaflet.draw-box';
</script>

README

Leaflet.draw-box

Leaflet Draw support for leaflet.box inspired by Leaflet.ellipse. Check out the Demo.

Important

Leaflet.draw-box requires

How to

Traditional

Include Leaflet.draw-box.js in your html

<script src='/path/to/leaflet.box.js'></script>
<script src='/path/to/Leaflet.draw-box.js'></script>

Webpack as non es6 module

import './path/to/leaflet.box'
import './path/to/Leaflet.draw-box'

ES6 module

TODO

Usage

See Leaflet.draw and leaflet.box

Creating:

new L.Draw.Box(map, options*).enable()

new L.Draw.Rect(map, options*).enable()

* Where options are the same structure as for Leaflet.draw

Toggling:

myRect.editing.enable()

myRect.editing.disable()

Checkout

leaflet.arc - Leaflet Arc drawing.

leaflet.draw-arc - Leaflet Draw support for leaflet.arc.

leaflet.sector - Leaflet Sector drawing.

leaflet.draw-sector - Leaflet Draw support for leaflet.sector.

License

This code is provided under the Apache 2.0 license.