Private enum for drag box event types

This commit is contained in:
Tim Schaub
2016-12-27 13:27:48 -07:00
parent ee833b0c2f
commit eede241e82

View File

@@ -103,7 +103,7 @@ ol.interaction.DragBox.handleDragEvent_ = function(mapBrowserEvent) {
this.box_.setPixels(this.startPixel_, mapBrowserEvent.pixel); this.box_.setPixels(this.startPixel_, mapBrowserEvent.pixel);
this.dispatchEvent(new ol.interaction.DragBox.Event(ol.interaction.DragBox.EventType.BOXDRAG, this.dispatchEvent(new ol.interaction.DragBox.Event(ol.interaction.DragBox.EventType_.BOXDRAG,
mapBrowserEvent.coordinate, mapBrowserEvent)); mapBrowserEvent.coordinate, mapBrowserEvent));
}; };
@@ -143,7 +143,7 @@ ol.interaction.DragBox.handleUpEvent_ = function(mapBrowserEvent) {
if (this.boxEndCondition_(mapBrowserEvent, if (this.boxEndCondition_(mapBrowserEvent,
this.startPixel_, mapBrowserEvent.pixel)) { this.startPixel_, mapBrowserEvent.pixel)) {
this.onBoxEnd(mapBrowserEvent); this.onBoxEnd(mapBrowserEvent);
this.dispatchEvent(new ol.interaction.DragBox.Event(ol.interaction.DragBox.EventType.BOXEND, this.dispatchEvent(new ol.interaction.DragBox.Event(ol.interaction.DragBox.EventType_.BOXEND,
mapBrowserEvent.coordinate, mapBrowserEvent)); mapBrowserEvent.coordinate, mapBrowserEvent));
} }
return false; return false;
@@ -166,7 +166,7 @@ ol.interaction.DragBox.handleDownEvent_ = function(mapBrowserEvent) {
this.startPixel_ = mapBrowserEvent.pixel; this.startPixel_ = mapBrowserEvent.pixel;
this.box_.setMap(mapBrowserEvent.map); this.box_.setMap(mapBrowserEvent.map);
this.box_.setPixels(this.startPixel_, this.startPixel_); this.box_.setPixels(this.startPixel_, this.startPixel_);
this.dispatchEvent(new ol.interaction.DragBox.Event(ol.interaction.DragBox.EventType.BOXSTART, this.dispatchEvent(new ol.interaction.DragBox.Event(ol.interaction.DragBox.EventType_.BOXSTART,
mapBrowserEvent.coordinate, mapBrowserEvent)); mapBrowserEvent.coordinate, mapBrowserEvent));
return true; return true;
} else { } else {
@@ -177,8 +177,9 @@ ol.interaction.DragBox.handleDownEvent_ = function(mapBrowserEvent) {
/** /**
* @enum {string} * @enum {string}
* @private
*/ */
ol.interaction.DragBox.EventType = { ol.interaction.DragBox.EventType_ = {
/** /**
* Triggered upon drag box start. * Triggered upon drag box start.
* @event ol.interaction.DragBox.Event#boxstart * @event ol.interaction.DragBox.Event#boxstart