leaflet-lasso
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "leaflet-lasso", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Leaflet plugin for lasso selection", | ||
"keywords": [ | ||
"leaflet" | ||
], | ||
"author": "Jan Zak <zj@zakjan.cz>", | ||
"licence": "MIT", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
@@ -8,0 +11,0 @@ "types": "dist/index.d.ts", |
@@ -7,2 +7,32 @@ # leaflet-lasso | ||
## Install | ||
- `npm install leaflet-lasso` | ||
- `import "leaflet-lasso"` | ||
or | ||
- `<script src="http://unpkg.com/leaflet-lasso@latest/dist/leaflet-lasso.min.js"></script>` | ||
## Usage | ||
``` | ||
const lasso = L.lasso(map); | ||
lasso.enable(); | ||
map.on('lasso.finished', (event) => { | ||
console.log(event.layers); | ||
}); | ||
``` | ||
## Methods | ||
- `enable()` | ||
- `disable()` | ||
## Events | ||
- `lasso.finished` | ||
- `lasso.enabled` | ||
- `lasso.disabled` | ||
## TODO | ||
@@ -9,0 +39,0 @@ |
@@ -83,3 +83,3 @@ import * as L from 'leaflet'; | ||
const selectedFeatures = this.getSelectedFeatures(this.polygon); | ||
const selectedFeatures = this.getSelectedLayers(this.polygon); | ||
this.map.fire('lasso.finished', { | ||
@@ -95,3 +95,3 @@ latLngs: this.polygon.getLatLngs()[0], | ||
getSelectedFeatures(polygon: L.Polygon) { | ||
getSelectedLayers(polygon: L.Polygon) { | ||
const selectedLayers: L.Layer[] = []; | ||
@@ -98,0 +98,0 @@ |
576423
41