Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leaflet-lasso

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-lasso

Leaflet plugin for lasso selection

  • 2.0.0-alpha2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.3K
increased by110.15%
Maintainers
1
Weekly downloads
 
Created
Source

leaflet-lasso

True lasso selection plugin for Leaflet. Demo

screenshot

Supports all Leaflet vector layers:

  • Marker
  • CircleMarker
  • Circle
  • Polyline
  • Polyline with multiple segments
  • Rectangle
  • Polygon
  • Polygon with hole
  • Polygon with multiple segments
  • Polygon with multiple segments and holes

Selection modes:

  • contain - entire shape must be in lasso polygon (default)
  • intersect - any part of shape can be in lasso polygon

Install

npm install leaflet-lasso
import "leaflet-lasso"

or

<script src="https://unpkg.com/leaflet-lasso@latest/dist/leaflet-lasso.umd.min.js"></script>

Usage

Control

const lasso = L.control.lasso().addTo(map);

Control in intersect mode

L.control.lasso({ intersect: true }).addTo(map);

Finished event

map.on('lasso.finished', event => {
    console.log(event.layers);
});

Handler

const lasso = L.lasso(map);
yourCustomButton.addEventListener('click', () => {
    lasso.enable();
});

API

See TypeScript type definitions

Thanks

Icon by @Falke-Design

Keywords

FAQs

Package last updated on 01 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc