Add a 'boxdrag' event to ol.interaction.DragBox. Resolves #4563 .
This commit is contained in:
@@ -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));
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user