Merge pull request #554 from zedd45/boxzoom

add start & end events for Map.BoxZoom
This commit is contained in:
Vladimir Agafonkin 2012-03-03 13:22:23 -08:00
commit b5d7d4c155

View File

@ -34,6 +34,8 @@ L.Map.BoxZoom = L.Handler.extend({
.addListener(document, 'mousemove', this._onMouseMove, this)
.addListener(document, 'mouseup', this._onMouseUp, this)
.preventDefault(e);
this._map.fire("boxzoomstart");
},
_onMouseMove: function (e) {
@ -72,5 +74,9 @@ L.Map.BoxZoom = L.Handler.extend({
map.layerPointToLatLng(layerPoint));
map.fitBounds(bounds);
map.fire("boxzoomend", {
boxZoomBounds: bounds
});
}
});