
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-canvas-marker-good
Advanced tools
Leaflet plugin for displaying markers on canvas instead of DOM. Working with Leaflet 1.0.0 and above. Feel free to contribute
There's a demo for 10000 points, running on Canvas
Just download leaflet.canvas-markers.js from the dist folder and attach it to your project.
<script src="leaflet.canvas-markers.js"></script>
Now attach layer to map and some markers.
// Adds a layer
var ciLayer = L.canvasIconLayer({}).addTo(map);
// Marker definition
var marker = L.marker([58.5578, 29.0087], {icon: icon});
// Adding marker to layer
ciLayer.addMarker(marker);
Plugin was tested in Google Chrome v66 & IE11. There is results for 100000 markers:
| Parameter | Default Leaflet Markers | Leaflet.Canvas-Markers |
|---|---|---|
| Memory used | up to 2.8 Gb | about 300 Mb |
| First load time | 160-200 seconds | <1 seconds |
| Zoom and move time | more than 3 minutes | 0.5 seconds |
As you can see DOM operations are slow, so you should use canvas for a large number of markers.
You can also use L.circleMarker for your points with similar performance, but then you're limited to icon design.
true if you want to redraw layer after marker removeI also implemented binds for default addLayer, addLayers and removeLayer (equal to removeMarker(marker, true) methods.
FAQs
Leaflet plugin to display markers on canvas instead of DOM
We found that leaflet-canvas-marker-good 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.