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.

Canvas CircleMarker flicker on cluster animation

See original GitHub issue

Originally https://github.com/Leaflet/Leaflet/issues/5011, reported by @stefanhagiu

When:

  • There is a markercluster
  • Which has its animated option is set to true
  • And has L.CircleMarkers instead of L.Markers
  • And the markers are rendered in a L.Canvas

then, the CircleMarkers will flicker during a zoom animation, as the cluster marker is destroyed/created and the individual markers are destroyed/created.

Reproducible test case:

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ghybscommented, Oct 15, 2016

Looks like it is caused by L.Canvas flag layer._removed https://github.com/Leaflet/Leaflet/blob/master/src/layer/vector/Canvas.js#L95

It is set when layer is removed from canvas, but cleared only on deferred _draw. Therefore when adding the layer to the canvas, it catches the flag and removes the layer from canvas just after having adding it…

Clearing that flag when calling _initPath looks to fix the issue. https://github.com/Leaflet/Leaflet/blob/master/src/layer/vector/Canvas.js#L87

Fixed Plunker: https://plnkr.co/edit/jm1qNpdEpPJPDRdXk9ja?p=preview

0reactions
IvanSanchezcommented, Oct 27, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML5/Canvas flickering animation - javascript - Stack Overflow
Have no idea how flickering happen or never happen in almost same code, same buffered. I've test it in Chrome 20 and FireFox...
Read more >
Leaflet circleMarker's not working - but marker works fine
Using Leaflet, I'm adding around 15,000 circleMarker's to a geoJson layer. The circleMarker's, however, are not showing on my map when the ...
Read more >
docker/korp/app/components/leaflet/CHANGELOG.md ... - GitLab
Fixed a regression that broke animation in Leaflet.markercluster. ... on a Canvas-powered CircleMarker would cause an infinite loop (by @snkashis).
Read more >
leaflet | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Autodesk Maya Online Help: Adjusting nParticle size and color
Click the far left circle marker (at Selected Position 0) of the ramp. Click the color swatch beside Selected Color. The Color Chooser...
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