Gathering detailed insights and metrics for @bopen/leaflet-area-selection
Gathering detailed insights and metrics for @bopen/leaflet-area-selection
Gathering detailed insights and metrics for @bopen/leaflet-area-selection
Gathering detailed insights and metrics for @bopen/leaflet-area-selection
Create and manipulate a polygonal area on a Leaflet map
npm install @bopen/leaflet-area-selection
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (84.63%)
CSS (12.37%)
HTML (2.2%)
Makefile (0.8%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
41 Stars
59 Commits
14 Forks
5 Watchers
2 Branches
18 Contributors
Updated on Jul 04, 2025
Latest Version
0.7.0
Package Id
@bopen/leaflet-area-selection@0.7.0
Unpacked Size
242.85 kB
Size
55.73 kB
File Count
12
NPM Version
6.14.16
Node Version
10.20.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
20
Create and manipulate a polygonal area on a Leaflet map
The primary target of this plugin is to obtain a customizable selected area while keeping high usability.
1npm install --save @bopen/leaflet-area-selection
1import L from 'leaflet'; 2import '@bopen/leaflet-area-selection/dist/index.css'; 3import { DrawAreaSelection } from '@bopen/leaflet-area-selection'; 4 5const map = L.map('root').setView([41.901493, 12.5009157], 13); 6 7L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { 8 attribution: 9 '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', 10}).addTo(map); 11 12const areaSelection = new DrawAreaSelection(); 13 14map.addControl(areaSelection);
Although we think it's time for Leaflet to move away from global L
object and open to modern JavaScript and tree-shaking, you can still use this plugin in the old way.
This gist contains a modified version of the Leaflet "Hello World" example: https://gist.github.com/keul/74e442b96a41c4f50e304c22259a63c3
The DrawAreaSelection
can receive a configuration object with followings supported options:
active
- the plugin starts as active, no need to run it from the buttonfadeOnActivation
- when actively drawing a new area the map is partially faded outonPolygonReady
- callback called during the adjustment phase (see below) every time a change is performed to the polygon (vertex moved, added or removed).onPolygonDblClick
- called when performing a double-click on the draw polygon when in the adjustment phase (see below).onButtonActivate
- called when user clicks on the button to enable draw a polygon.preventDefault
on the event will abort the activation.onButtonDeactivate
- called when user clicks on the button to stop drawing the polygon.preventDefault
on the event will abort the deactivation.When the plugin is activated by using the new control, the map enters in a drawing phase.
Clicks on the map will trigger the creation of a vertex for the polygon.
User can continue adding vertexes to the polygon (min length is 3) until the whole required area is covered.
To complete the polygon drawing phase user must click on the first (green) point created.
Alternatively: on the first click you can drag&drop and directly create a square shape (note: this method is not currently working on mobile!).
At this point we enter the adjustment phase, where user can:
See also the live example.
This plugin is heavily inspired by the "draw on map" feature provided on Immobiliare.it website.
MIT © B-Open
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/24 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
91 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More