New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix extra tile usage #4193
Fix extra tile usage #4193
Conversation
@@ -444,7 +445,8 @@ L.GridLayer = L.Layer.extend({ | |||
|
|||
_getTiledPixelBounds: function (center) { | |||
var map = this._map, | |||
scale = map.getZoomScale(map.getZoom(), this._tileZoom), | |||
mapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(), | |||
scale = map.getZoomScale(mapZoom, this._tileZoom), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to insist a bit, but as per my understanding we don't need scale: if the map size is 600px at zoom 10 it will still be 600px at zoom 11 or 17 or 17.358, isn't it? Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yohanboniface You're missing fractional zoom. In those cases, 0.5 < scale < 2. See the debug/tests/tile-bounds.html
file.
e.g. if the zoom level is 17.348, and the map is 600px, then there are less than 600px worth of tiles (and less tiles are loaded) because tile pixels are bigger.
That's just asking for double brainmelt in future. :) |
@mourner Actually, I don't think so. Layers should clear everything up on God, I want leafdoc merged in so I can document these kind of things inline right away. |
Why are we not there yet? |
I think this PR introduces some kind of race condition on |
09dd957
to
efdc626
Compare
Some debugging on tile-events.html:
|
#4145 also OK with this one: |
Should fix #4180
Added a new
viewprereset
map event, run before theviewreset
event.So the sequence for when
fadeAnimation
is false is: unload tiles onviewprereset
, then move the map to the proper viewport, then load tiles onviewreset
. This makes PhantomJS a viable option for unit-testing tile loading counts.Unit tests in graphical browers do fail as of now, though.