Map freezezes when loading about (13000) markers

2 posts / 0 new
Last post
Map freezezes when loading about (13000) markers


We are using leaflet API to populate around 13000 markers.

We found a problem while rendering the markers as it freezes the browser(Chrome) - often requiring us to use task manager and kill process.

We tried a method (In loop):

var marker = new L.Marker(locations, { icon: new markerIcon() });
marker.desc = datum.d;

Could you suggest if there is an issue; the way we are using leaflet API? Please advise. 

Thank you,

13,000 objects in JavaScript

13,000 objects in JavaScript can bog down a browser. 13,000 markers on a map can easily bring a browser to its knees. There are several methods to show that large data sets on a map without crushing it: reduce the number of markers, only display markers within the viewport at certain zoom levels, heatmap, clusters, and others.