fixed animation for leaflet 0.7.x

This commit is contained in:
javi 2014-03-24 14:57:23 +01:00
parent 9cad1a3d18
commit fd5efd6ce2

View File

@ -114,6 +114,8 @@ L.CanvasLayer = L.Class.extend({
var pos = this._canvas._leaflet_pos || { x: 0, y: 0 }; var pos = this._canvas._leaflet_pos || { x: 0, y: 0 };
back.getContext('2d').drawImage(this._canvas, 0, 0); back.getContext('2d').drawImage(this._canvas, 0, 0);
L.DomUtil.setPosition(back, L.DomUtil.getPosition(this._canvas));
// hide original // hide original
this._canvas.style.display = 'none'; this._canvas.style.display = 'none';
back.style.display = 'block'; back.style.display = 'block';
@ -129,13 +131,16 @@ L.CanvasLayer = L.Class.extend({
var bg = back; var bg = back;
var transform = L.DomUtil.TRANSFORM; var transform = L.DomUtil.TRANSFORM;
bg.style[transform] = L.DomUtil.getTranslateString(origin) + ' scale(' + e.scale + ') '; setTimeout(function() {
bg.style[transform] = L.DomUtil.getTranslateString(origin) + ' scale(' + e.scale + ') ';
}, 0)
}, },
_endZoomAnim: function () { _endZoomAnim: function () {
this._animating = false; this._animating = false;
this._canvas.style.display = 'block'; this._canvas.style.display = 'block';
this._backCanvas.style.display = 'none'; this._backCanvas.style.display = 'none';
this._backCanvas.style[L.DomUtil.TRANSFORM] = '';
}, },
getCanvas: function() { getCanvas: function() {