question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Poor performance with many markers

See original GitHub issue
  • I’m reporting a bug, not asking for help; support questions like “How can I do X with Leaflet?” will be closed (use Stack Overflow or gis.stackexchange.com for questions)
  • I’ve looked at the documentation to make sure the behaviour is documented and expected
  • I’m sure this is a Leaflet code issue, not an issue with my own code nor with the framework I’m using (Cordova, Ionic, Angular, React…)
  • I’ve searched through the issues to make sure it’s not yet reported

How to reproduce

  • Leaflet version I’m using: 1.3.4
  • Browser (with version) I’m using: Chromium 68
  • OS/Platform (with version) I’m using: Debian Buster
  • Place many markers to the map (eg. 1000)
  • Move or zoom the map

What behaviour I’m expecting and which behaviour I’m seeing

Start of the movement is delayed and eats 100% of the CPU core. The same for the zoom. Delay si caused by getBoundingClientRect:

image

Minimal example reproducing the issue

  • this example is as simple as possible
  • this example does not rely on any third party code

https://codepen.io/zdila/pen/YOwoEd

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
manubbcommented, Aug 27, 2018

If you need to draw many markers, you can try Leaflet.PixiOverlay plugin. (i’m the plugin author by the way)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Leaflet getting slow when there are huge amount of custom ...
A common way is to use Marker Clustering. This way your huge amount of markers gets grouped into a smaller amount while still...
Read more >
Performance – Markers (500+) showing up delayed / slowly
Hello there,. we are experiencing quite a delay from the inital page- / mapload to the markers showing up. We have around 500...
Read more >
When does combining markers improve classification ... - NCBI
We find that an uncorrelated continuous marker with moderate performance on its own usually yields only minimally improved performance. We ...
Read more >
Optimization Guide | Google Maps Platform
Optimization enhances performance by rendering many markers as a single static element. This is useful in cases where a large number of markers...
Read more >
High performance markers on Leaflet map [closed]
If not, any other way I can get better performance with that many markers? I tried with a conditionalLayer, but it's too slow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found