{"id":13859218,"url":"https://github.com/zakjan/leaflet-lasso","last_synced_at":"2025-06-12T18:35:53.486Z","repository":{"id":34574660,"uuid":"137734898","full_name":"zakjan/leaflet-lasso","owner":"zakjan","description":"Lasso selection plugin for Leaflet","archived":false,"fork":false,"pushed_at":"2025-02-20T18:25:50.000Z","size":2344,"stargazers_count":115,"open_issues_count":3,"forks_count":21,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-15T21:19:58.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://zakjan.github.io/leaflet-lasso/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zakjan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"zakjan"}},"created_at":"2018-06-18T09:48:27.000Z","updated_at":"2025-03-31T09:18:02.000Z","dependencies_parsed_at":"2023-10-03T16:47:25.611Z","dependency_job_id":"0cca4b7b-93a1-451d-a4b3-60cf1fe48516","html_url":"https://github.com/zakjan/leaflet-lasso","commit_stats":{"total_commits":151,"total_committers":7,"mean_commits":"21.571428571428573","dds":0.1589403973509934,"last_synced_commit":"9c00276d33589ef9be57fed930237406803acee4"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/zakjan/leaflet-lasso","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakjan%2Fleaflet-lasso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakjan%2Fleaflet-lasso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakjan%2Fleaflet-lasso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakjan%2Fleaflet-lasso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zakjan","download_url":"https://codeload.github.com/zakjan/leaflet-lasso/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakjan%2Fleaflet-lasso/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259519288,"owners_count":22870332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-05T03:02:37.582Z","updated_at":"2025-06-12T18:35:48.459Z","avatar_url":"https://github.com/zakjan.png","language":"TypeScript","funding_links":["https://github.com/sponsors/zakjan"],"categories":["TypeScript"],"sub_categories":[],"readme":"# leaflet-lasso\n\n[![](https://img.shields.io/npm/dm/leaflet-lasso)](https://www.npmjs.com/package/leaflet-lasso)\n[![](https://img.shields.io/david/zakjan/leaflet-lasso)](https://www.npmjs.com/package/leaflet-lasso)\n[![](https://img.shields.io/bundlephobia/min/leaflet-lasso)](https://www.npmjs.com/package/leaflet-lasso)\n\nLasso selection plugin for Leaflet\n\n[Demo](https://zakjan.github.io/leaflet-lasso/)\n\n\u003cimg src=\"docs/screenshot@2x.jpg\" alt=\"Screenshot\" width=\"640\" height=\"320\"\u003e\n\nSupports all Leaflet vector layers:\n\n- Marker\n- CircleMarker\n- Circle\n- Polyline\n- Polyline with multiple segments\n- Rectangle\n- Polygon\n- Polygon with hole\n- Polygon with multiple segments\n- Polygon with multiple segments and holes\n- Custom layers can be supported if they inherit from the above layers, and have `getBounds` and `toGeoJSON` methods\n\nSelection modes:\n\n- contain - entire shape must be in lasso polygon (default)\n- intersect - any part of shape can be in lasso polygon\n\n## Install\n\n```\nnpm install leaflet-lasso\n```\n\nor\n\n```\n\u003cscript src=\"https://unpkg.com/leaflet-lasso@2.2.13/dist/leaflet-lasso.umd.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n```\nimport \"leaflet-lasso\";\n```\n\nFor detailed API, please see exported TypeScript typings.\n\n### Handler\n\nUse for custom activation.\n\n```\ninterface LassoHandlerOptions {\n    polygon?: L.PolylineOptions,\n    intersect?: boolean;\n}\n```\n\n```\nconst lasso = L.lasso(map, options);\nyourCustomButton.addEventListener('click', () =\u003e {\n    lasso.enable();\n});\n```\n\n### Control\n\nUse for default control.\n\n```\ninterface LassoControlOptionsData  {\n    title?: string;\n}\n\ntype LassoControlOptions = L.ControlOptions \u0026 LassoControlOptionsData \u0026 LassoHandlerOptions;\n```\n\n```\nL.control.lasso(options).addTo(map);\n```\n\n### Finished event\n\nListen for this event to receive matching Leaflet layers.\n\n```\ninterface LassoHandlerFinishedEventData {\n    originalEvent: MouseEvent;\n    latLngs: L.LatLng[];\n    layers: L.Layer[];\n}\n\ntype LassoHandlerFinishedEvent = L.LeafletEvent \u0026 LassoHandlerFinishedEventData;\n```\n\n```\nmap.on('lasso.finished', (event: LassoHandlerFinishedEvent) =\u003e {\n    console.log(event.layers);\n});\n```\n\n## Thanks\n\nIcon by @Falke-Design\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakjan%2Fleaflet-lasso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzakjan%2Fleaflet-lasso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakjan%2Fleaflet-lasso/lists"}