Merge pull request #4574 from WeaveTeam/dragbox-config-pr

Added boxEndCondition to DragBoxOptions to replace the hardcoded chec…
This commit is contained in:
Andreas Hocevar
2016-01-06 11:47:56 +01:00
2 changed files with 57 additions and 6 deletions
+21 -1
View File
@@ -2361,7 +2361,8 @@ olx.interaction.DragAndDropOptions.prototype.projection;
/**
* @typedef {{className: (string|undefined),
* condition: (ol.events.ConditionType|undefined)}}
* condition: (ol.events.ConditionType|undefined),
* boxEndCondition: (ol.interaction.DragBoxEndConditionType|undefined)}}
* @api
*/
olx.interaction.DragBoxOptions;
@@ -2385,6 +2386,25 @@ olx.interaction.DragBoxOptions.prototype.className;
olx.interaction.DragBoxOptions.prototype.condition;
/**
* A function that takes a {@link ol.MapBrowserEvent} and two
* {@link ol.Pixel}s to indicate whether a boxend event should be fired.
* Default is:
* ```js
* function(mapBrowserEvent,
* startPixel, endPixel) {
* var width = endPixel[0] - startPixel[0];
* var height = endPixel[1] - startPixel[1];
* return width * width + height * height >=
* ol.DRAG_BOX_HYSTERESIS_PIXELS_SQUARED;
* }
* ```
* @type {ol.interaction.DragBoxEndConditionType|undefined}
* @api
*/
olx.interaction.DragBoxOptions.prototype.boxEndCondition;
/**
* @typedef {{kinetic: (ol.Kinetic|undefined)}}
* @api