Add ol.DragBoxEvent

This commit is contained in:
Antoine Abt
2013-12-19 15:41:52 +01:00
parent 0eb00ba86b
commit 43b8a72e62
2 changed files with 46 additions and 0 deletions

View File

@@ -1 +1,4 @@
@exportSymbol ol.interaction.DragBox
@exportSymbol ol.DragBoxEvent
@exportProperty ol.DragBoxEvent.prototype.getCoordinate

View File

@@ -1,9 +1,11 @@
// FIXME draw drag box
// FIXME works for View2D only
goog.provide('ol.DragBoxEvent');
goog.provide('ol.interaction.DragBox');
goog.require('goog.asserts');
goog.require('goog.events.Event');
goog.require('ol.events.ConditionType');
goog.require('ol.events.condition');
goog.require('ol.interaction.Drag');
@@ -24,6 +26,47 @@ ol.DRAG_BOX_HYSTERESIS_PIXELS_SQUARED =
ol.DRAG_BOX_HYSTERESIS_PIXELS;
/**
* @enum {string}
*/
ol.DragBoxEventType = {
BOXSTART: 'boxstart',
BOXEND: 'boxend'
};
/**
* Object representing a dragbox event.
*
* @param {string} type The event type.
* @param {ol.Coordinate} coordinate The event coordinate.
* @extends {goog.events.Event}
* @constructor
*/
ol.DragBoxEvent = function(type, coordinate) {
goog.base(this, type);
/**
* The coordinate of the drag event.
* @type {ol.Coordinate}
* @private
*/
this.coordinate_ = coordinate;
};
goog.inherits(ol.DragBoxEvent, goog.events.Event);
/**
* Get the name of the property associated with this event.
* @return {ol.Coordinate} Event coordinate.
*/
ol.DragBoxEvent.prototype.getCoordinate = function() {
return this.coordinate_;
};
/**
* @constructor