diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index d6f41a4461..2501eab27d 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -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 */ diff --git a/src/ol/interaction/dragboxinteraction.js b/src/ol/interaction/dragboxinteraction.js index 933f07d303..81c03af21f 100644 --- a/src/ol/interaction/dragboxinteraction.js +++ b/src/ol/interaction/dragboxinteraction.js @@ -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