Add style option to DragBox interaction

This commit is contained in:
Éric Lemoine
2013-12-05 11:30:46 +01:00
committed by Antoine Abt
parent 18f9eeab12
commit eb840777e8
2 changed files with 9 additions and 1 deletions

View File

@@ -318,6 +318,7 @@
* @property {ol.events.ConditionType|undefined} condition A conditional
* modifier (i.e. Shift key) that determines if the interaction is active
* or not, default is always.
* @property {ol.style.Style} style Style for the box.
* @todo stability experimental
*/

View File

@@ -44,11 +44,18 @@ ol.interaction.DragBox = function(opt_options) {
this.behavior_ = goog.isDef(options.behavior) ?
options.behavior : goog.nullFunction;
/**
* @private
* @type {ol.style.Style}
*/
var style = goog.isDef(options.style) ? options.style : null;
/**
* @type {ol.render.Box}
* @private
*/
this.box_ = new ol.render.Box();
this.box_ = new ol.render.Box(style);
/**
* @private