Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
leaflet-markers-canvas
Advanced tools
A Leaflet plugin to render many markers in a canvas instead of the DOM
A Leaflet plugin to render many markers in a canvas instead of the DOM.
This is a complete rewrite of Leaflet.Canvas-Markers by Eugene Voynov. Thank you for the inspiration.
Here is a demo of 10000 markers, displayed in one canvas.
Leaflet and RBush must be available globally or installed as peer-dependencies.
npm i leaflet-markers-canvas
var map = L.map("map").setView([59.9578, 30.2987], 10);
var tiles = L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png", {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a>',
preferCanvas: true,
}).addTo(map);
var markersCanvas = new L.MarkersCanvas();
markersCanvas.addTo(map);
var icon = L.icon({
iconUrl: "marker.png",
iconSize: [20, 32],
iconAnchor: [10, 0],
});
var markers = [];
for (var i = 0; i < 10000; i++) {
var marker = L.marker(
[58.5578 + Math.random() * 1.8, 29.0087 + Math.random() * 3.6],
{ icon }
)
.bindPopup("I Am " + i)
.on({
mouseover(e) {
this.openPopup();
},
mouseout(e) {
this.closePopup();
},
});
markers.push(marker);
}
markersCanvas.addMarkers(markers);
addTo(map)
getBounds()
redraw()
clear()
addMarker(marker)
addMarkers(markers)
removeMarker(marker)
removeMarkers(markers)
FAQs
A Leaflet plugin to render many markers in a canvas instead of the DOM
The npm package leaflet-markers-canvas receives a total of 503 weekly downloads. As such, leaflet-markers-canvas popularity was classified as not popular.
We found that leaflet-markers-canvas 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 researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.