bopen / leaflet-area-selection

Create and manipulate a polygonal area on a Leaflet map
https://bopen.github.io/leaflet-area-selection/
MIT License
36 stars 14 forks source link

Enable without use of button #6

Closed nosehair closed 2 years ago

nosehair commented 2 years ago

How can I activate the draw feature manually?

So something like

const areaSelection = new DrawAreaSelection({ withButton: false})
areaSelection.addTo(map)

areaSelection.activate()

I'd like to use my own button and place it outside of the map area.

keul commented 2 years ago

@nosehair not possible right now, but see https://github.com/bopen/leaflet-area-selection/pull/5

keul commented 2 years ago

Closed by #5

keul commented 2 years ago

Example: https://github.com/bopen/leaflet-area-selection/blob/aeaec30f0500c3e5064e43856d403abfee8da872/example/src/index.js#L77:L84