[x] I've looked at the documentation to make sure the behavior is documented and expected
[x] 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…)
[x] I've searched through the issues to make sure it's not yet reported
Steps to reproduce
Steps to reproduce the behavior:
Create a tile layer
Set events for zoomstart, zoomend, loading and load and add a simple console.log for each
Play with zoom
Sometimes the load event only starts once: screenshot
Some other times it fires twice during the same animation: screenshot
Note: these were all 1-level zoom changes.
Now, add zoomAnimation = false when initializing the map. The tile loads once every time
Expected behavior
The tile should only be loading once, like it does with no animations
Current behavior
The tile is sometimes loading multiple times during the same zoom animation
Additional context
The feature I'm trying to work on relies on the tile's load event to load features onto the map. Every time the tile loads I have to remove the previous ones and load a new set of features. But with the animations turned on and the tiles loading twice in a row I get a lot of flickering. The only way I've found to make sure my features are loaded only once is disabling zoom animations.
I found the zoomAnimation workaround browsing other issues. See #7234 , except in my case I didn't need to turn off fade animations as well.
Steps to reproduce Steps to reproduce the behavior:
Expected behavior The tile should only be loading once, like it does with no animations
Current behavior The tile is sometimes loading multiple times during the same zoom animation
Environment
Additional context The feature I'm trying to work on relies on the tile's load event to load features onto the map. Every time the tile loads I have to remove the previous ones and load a new set of features. But with the animations turned on and the tiles loading twice in a row I get a lot of flickering. The only way I've found to make sure my features are loaded only once is disabling zoom animations. I found the zoomAnimation workaround browsing other issues. See #7234 , except in my case I didn't need to turn off fade animations as well.
Minimal example reproducing the issue
https://plnkr.co/edit/ENeOvh40r1t3BXkL