
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
leaflet-trace
Advanced tools
This plugin is an extension for Leaflet.Draw that includes a new set of tools which allow the user to select a line and trace along it.
It requires Leaflet.Draw and @turf/turf. It also includes code based on Leaflet.AlmostOver and Leaflet.GeometryUtil, altered to fit the needs of this plugin.
Play with it here
To include it in your app using a cdn add the following to the top of your html
<link rel="stylesheet" type="text/css" href="https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw-src.css" />
<script src="https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@turf/turf@6/turf.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet-trace@0.3.1/dist/leaflet.trace.css" />
<script type="module" src="https://unpkg.com/leaflet-trace@0.3.1/dist/leaflet.trace.js"></script>
If you install using npm adding this to your html should do the trick:
<link rel="stylesheet" type="text/css" href="../node_modules/leaflet/dist/leaflet.css"/>
<script src="../node_modules/leaflet-draw/dist/leaflet.draw.js"></script>
<script src="../node_modules/@turf/turf/turf.min.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="../node_modules/leaflet-trace/dist/leaflet.trace.css"/>
<script src="../node_modules/leaflet-trace/dist/leaflet.trace.js"></script>
Leaflet.Trace mainly extends L.Control.Draw to add a new set of 3 tools that work together to allow users to trace along a selected line and snap a marker to a selected line.
It is initalized similarly to L.Control.Draw, with the addition of a trace option.
new L.Control.Trace({
trace: true,
draw: {
circlemarker: false, //Leaflet.Trace includes a slightly altered version of the L.Draw.CircleMarker
},
edit: {
featureGroup: drawnItems,
},
}).addTo(map);
Leaflet.Trace works with L.geoJSON layers that contain a FeatureCollection made up of LineString and MultiLineString features.
For Leaflet.Trace to be able to detect your L.geoJSON you need to give it an attribute of "trace" set to "true".
const lines = L.geoJSON(featureCollection).addTo(map);
lines.trace = true;
FAQs
Simple tool to select and trace lines in leaflet
The npm package leaflet-trace receives a total of 38 weekly downloads. As such, leaflet-trace popularity was classified as not popular.
We found that leaflet-trace 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.