simplify vector animation, @danzel check it out lol

This commit is contained in:
Vladimir Agafonkin 2012-10-18 16:38:31 +03:00
parent 628a5b4ce0
commit 5fa25c28a4

View File

@ -162,11 +162,11 @@ L.Map.include({
_animatePathZoom: function (opt) {
var scale = this.getZoomScale(opt.zoom),
offset = this._getCenterOffset(opt.center).divideBy(1 - 1 / scale),
viewportPos = this.containerPointToLayerPoint(this.getSize().multiplyBy(-L.Path.CLIP_PADDING)),
origin = viewportPos.add(offset).round();
offset = this._getCenterOffset(opt.center),
translate = offset.multiplyBy(-scale)._add(this._pathViewport.min);
this._pathRoot.style[L.DomUtil.TRANSFORM] = L.DomUtil.getTranslateString((origin.multiplyBy(-1).add(L.DomUtil.getPosition(this._pathRoot)).multiplyBy(scale).add(origin))) + ' scale(' + scale + ') ';
this._pathRoot.style[L.DomUtil.TRANSFORM] =
L.DomUtil.getTranslateString(translate) + ' scale(' + scale + ') ';
this._pathZooming = true;
},