Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
leaflet-measure
Advanced tools
Coordinate, linear, and area measure control for Leaflet maps. Extends L.Control.
Clone.. git clone https://github.com/ljagis/leaflet-measure.git
Install with Bower.. bower install leaflet-measure
Install with npm.. npm install leaflet-measure
leaflet-measure.min.js
or leaflet-measure.js
Include the Leaflet Source, leaflet-measure.min.js
, and associated CSS stylesheets in your HTML page
<!doctype HTML>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css">
<link rel="stylesheet" href="leaflet-measure.css">
</head>
<body>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="leaflet-measure.min.js"></script>
<script>
// Start creating maps
</script>
</body>
</html>
var L = require('leaflet');
require('leaflet-measure');
// Start creating maps
leaflet-measure
adds L.Control.Measure
. This control may be used with the standard Leaflet control workflows described in the Leaflet docs.
The measure control can be instantiated directly and added to a map:
var myMap = L.map('mapElementId', options);
var measureControl = new L.Control.Measure(options);
measureControl.addTo(myMap);
or instantiated via the factory:
var myMap = L.map('mapElementId', options);
var measureControl = L.control.measure(options);
measureControl.addTo(myMap);
or added to a map using map options:
var myMap = L.map('mapElementId', {
measureControl: true
});
{ position: 'topright' }
Standard Leaflet control position options
{ markerSize: 4 }
Size of circle marker used as symbology for vertexes of measurement graphics. All other map feature styles (marker colors, area color and opacity, line widths, etc..) can be customized using CSS. Marker size is not available for styling in this way.
popupOptions: { className: 'leaflet-measure-resultpopup', autoPanPadding: [10, 10] }
Options applied to the popup of the resulting measure feature. Properties my be any standard Leaflet popup options.
Map features may be styled using CSS SVG style attributes. Features generated from leaflet-measure
measurements are given the following class names:
layer-measurecollector: Transparent layer covering full map and catching click and drag events
layer-measurearea: Feature displaying area of an active measurement
layer-measureboundary: Feature displaying the linear path of an active measurement
layer-measurevertex: Feature added at each vertex (measurement click) of an active measurement
layer-measuredrag: Symbol following cursor while moving during an active measurement
layer-measure-resultarea: Feature added to the map as a permanent layer resulting from an area (3+ points) measurement
layer-measure-resultline: Feature added to the map as a permanent layer resulting from a linear (2 point) measurement
layer-measure-resultpoint: Featured added to the map as a permanent layer resulting from a point (single click) measurement
FAQs
Coordinate, linear, and area measure tool for Leaflet maps
The npm package leaflet-measure receives a total of 3,199 weekly downloads. As such, leaflet-measure popularity was classified as popular.
We found that leaflet-measure demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.