Merge pull request #961 from danzel/canvas-fixes

Optimize _requestUpdate in Path.Canvas.
This commit is contained in:
Vladimir Agafonkin 2012-09-11 02:32:34 -07:00
commit 1933ae157c

View File

@ -42,13 +42,13 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path :
},
_requestUpdate: function () {
if (this._map) {
L.Util.cancelAnimFrame(this._fireMapMoveEnd);
this._updateRequest = L.Util.requestAnimFrame(this._fireMapMoveEnd, this._map);
if (this._map && !L.Path._updateRequest) {
L.Path._updateRequest = L.Util.requestAnimFrame(this._fireMapMoveEnd, this._map);
}
},
_fireMapMoveEnd: function () {
L.Path._updateRequest = null;
this.fire('moveend');
},