fix chrome zoom anim flickering near map borders

This commit is contained in:
Vladimir Agafonkin 2013-06-27 19:36:20 -04:00
parent 3d1f0957e7
commit 859c62f0e7

View File

@ -4,28 +4,13 @@
L.TileLayer.include({
_animateZoom: function (e) {
var firstFrame = false;
if (!this._animating) {
this._animating = true;
firstFrame = true;
}
if (firstFrame) {
this._prepareBgBuffer();
}
var bg = this._bgBuffer;
if (firstFrame) {
//prevent bg buffer from clearing right after zoom
clearTimeout(this._clearBgBufferTimer);
// hack to make sure transform is updated before running animation
L.Util.falseFn(bg.offsetWidth);
}
var transform = L.DomUtil.TRANSFORM,
var bg = this._bgBuffer,
transform = L.DomUtil.TRANSFORM,
initialTransform = e.delta ? L.DomUtil.getTranslateString(e.delta) : bg.style[transform],
scaleStr = L.DomUtil.getScaleString(e.scale, e.origin);
@ -85,6 +70,9 @@ L.TileLayer.include({
bg = this._bgBuffer = front;
this._stopLoadingImages(bg);
//prevent bg buffer from clearing right after zoom
clearTimeout(this._clearBgBufferTimer);
},
_getLoadedTilesPercentage: function (container) {