diff --git a/externs/olx.js b/externs/olx.js index aba6f65df3..6f7253638a 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -5,49 +5,6 @@ let olx; -/** - * @typedef {{className: (string|undefined), - * condition: (ol.EventsConditionType|undefined), - * duration: (number|undefined), - * out: (boolean|undefined)}} - */ -olx.interaction.DragZoomOptions; - - -/** - * CSS class name for styling the box. The default is `ol-dragzoom`. - * @type {string|undefined} - * @api - */ -olx.interaction.DragZoomOptions.prototype.className; - - -/** - * A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean - * to indicate whether that event should be handled. - * Default is {@link ol.events.condition.shiftKeyOnly}. - * @type {ol.EventsConditionType|undefined} - * @api - */ -olx.interaction.DragZoomOptions.prototype.condition; - - -/** - * Animation duration in milliseconds. Default is `200`. - * @type {number|undefined} - * @api - */ -olx.interaction.DragZoomOptions.prototype.duration; - - -/** - * Use interaction for zooming out. Default is `false`. - * @type {boolean|undefined} - * @api - */ -olx.interaction.DragZoomOptions.prototype.out; - - /** * @typedef {{clickTolerance: (number|undefined), * features: (ol.Collection.|undefined), diff --git a/externs/xol.js b/externs/xol.js index bad56e6d09..7dc83663ef 100644 --- a/externs/xol.js +++ b/externs/xol.js @@ -1,15 +1,4 @@ -/** - * @typedef {Object} interaction_DragZoomOptions - * @property {string|undefined} className CSS class name for styling the box. The default is `ol-dragzoom`. - * @property {ol.EventsConditionType|undefined} condition A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean - * to indicate whether that event should be handled. - * Default is {@link ol.events.condition.shiftKeyOnly}. - * @property {number|undefined} duration Animation duration in milliseconds. Default is `200`. - * @property {boolean|undefined} out Use interaction for zooming out. Default is `false`. - */ - - /** * @typedef {Object} interaction_DrawOptions * @property {number|undefined} clickTolerance The maximum distance in pixels between "down" and "up" for a "up" event diff --git a/src/ol/interaction/DragZoom.js b/src/ol/interaction/DragZoom.js index 839d892c64..ffaa340c8b 100644 --- a/src/ol/interaction/DragZoom.js +++ b/src/ol/interaction/DragZoom.js @@ -7,18 +7,32 @@ import {shiftKeyOnly} from '../events/condition.js'; import {createOrUpdateFromCoordinates, getBottomLeft, getCenter, getTopRight, scaleFromCenter} from '../extent.js'; import DragBox from '../interaction/DragBox.js'; + +/** + * @typedef {Object} Options + * @property {string} [className='ol-dragzoom'] CSS class name for styling the + * box. + * @property {module:ol/events/condition~Condition} [condition] A function that + * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a + * boolean to indicate whether that event should be handled. + * Default is {@link module:ol/events/condition~shiftKeyOnly}. + * @property {number} [duration=200] Animation duration in milliseconds. + * @property {boolean} [out=false] Use interaction for zooming out. + */ + + /** * @classdesc * Allows the user to zoom the map by clicking and dragging on the map, - * normally combined with an {@link ol.events.condition} that limits + * normally combined with an {@link module:ol/events/condition} that limits * it to when a key, shift by default, is held down. * * To change the style of the box, use CSS and the `.ol-dragzoom` selector, or * your custom one configured with `className`. * * @constructor - * @extends {ol.interaction.DragBox} - * @param {olx.interaction.DragZoomOptions=} opt_options Options. + * @extends {module:ol/interaction/DragBox~DragBox} + * @param {ol/interaction/DragZoom~Options=} opt_options Options. * @api */ const DragZoom = function(opt_options) { @@ -54,7 +68,7 @@ inherits(DragZoom, DragBox); DragZoom.prototype.onBoxEnd = function() { const map = this.getMap(); - const view = /** @type {!ol.View} */ (map.getView()); + const view = /** @type {!module:ol/View~View} */ (map.getView()); const size = /** @type {!module:ol/size~Size} */ (map.getSize());