Merge pull request #4666 from WeaveTeam/dragbox-dragevent-pr

Add a 'boxdrag' event to ol.interaction.DragBox. Resolves #4563 .
This commit is contained in:
Andreas Hocevar
2016-01-13 12:43:26 +01:00

View File

@@ -29,6 +29,14 @@ ol.DragBoxEventType = {
* @api stable
*/
BOXSTART: 'boxstart',
/**
* Triggered on drag when box is active.
* @event ol.DragBoxEvent#boxdrag
* @api
*/
BOXDRAG: 'boxdrag',
/**
* Triggered upon drag box end.
* @event ol.DragBoxEvent#boxend
@@ -167,6 +175,9 @@ ol.interaction.DragBox.handleDragEvent_ = function(mapBrowserEvent) {
}
this.box_.setPixels(this.startPixel_, mapBrowserEvent.pixel);
this.dispatchEvent(new ol.DragBoxEvent(ol.DragBoxEventType.BOXDRAG,
mapBrowserEvent.coordinate, mapBrowserEvent));
};