diff --git a/externs/olx.js b/externs/olx.js index f63dc86ff3..91049d7314 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -46,61 +46,6 @@ olx.interaction.TranslateOptions.prototype.layers; olx.interaction.TranslateOptions.prototype.hitTolerance; -/** - * @typedef {{constrainResolution: (boolean|undefined), - * condition: (ol.EventsConditionType|undefined), - * duration: (number|undefined), - * timeout: (number|undefined), - * useAnchor: (boolean|undefined)}} - */ -olx.interaction.MouseWheelZoomOptions; - - -/** - * 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.always}. - * @type {ol.EventsConditionType|undefined} - * @api - */ -olx.interaction.MouseWheelZoomOptions.prototype.condition; - - -/** - * Animation duration in milliseconds. Default is `250`. - * @type {number|undefined} - * @api - */ -olx.interaction.MouseWheelZoomOptions.prototype.duration; - - -/** - * Mouse wheel timeout duration in milliseconds. Default is `80`. - * @type {number|undefined} - * @api - */ -olx.interaction.MouseWheelZoomOptions.prototype.timeout; - - -/** - * When using a trackpad or magic mouse, zoom to the closest integer zoom level - * after the scroll gesture ends. - * Default is `false`. - * @type {boolean|undefined} - * @api - */ -olx.interaction.MouseWheelZoomOptions.prototype.constrainResolution; - - -/** - * Enable zooming using the mouse's location as the anchor. Default is `true`. - * When set to false, zooming in and out will zoom to the center of the screen - * instead of zooming on the mouse's location. - * @type {boolean|undefined} - * @api - */ -olx.interaction.MouseWheelZoomOptions.prototype.useAnchor; - - /** * @typedef {{threshold: (number|undefined), * duration: (number|undefined)}} diff --git a/externs/xol.js b/externs/xol.js index ef9417d8d9..7b38e3eedd 100644 --- a/externs/xol.js +++ b/externs/xol.js @@ -14,21 +14,6 @@ */ -/** - * @typedef {Object} interaction_MouseWheelZoomOptions - * @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.always}. - * @property {number|undefined} duration Animation duration in milliseconds. Default is `250`. - * @property {number|undefined} timeout Mouse wheel timeout duration in milliseconds. Default is `80`. - * @property {boolean|undefined} constrainResolution When using a trackpad or magic mouse, zoom to the closest integer zoom level - * after the scroll gesture ends. - * Default is `false`. - * @property {boolean|undefined} useAnchor Enable zooming using the mouse's location as the anchor. Default is `true`. - * When set to false, zooming in and out will zoom to the center of the screen - * instead of zooming on the mouse's location. - */ - - /** * @typedef {Object} interaction_PinchRotateOptions * @property {number|undefined} duration The duration of the animation in milliseconds. Default is `250`. diff --git a/src/ol/interaction/MouseWheelZoom.js b/src/ol/interaction/MouseWheelZoom.js index cc8949cbe9..28d49211e0 100644 --- a/src/ol/interaction/MouseWheelZoom.js +++ b/src/ol/interaction/MouseWheelZoom.js @@ -27,13 +27,30 @@ export const Mode = { }; +/** + * @typedef {Object} Options + * @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~always}. + * @property {number} [duration=250] Animation duration in milliseconds. + * @property {number} [timeout=80] Mouse wheel timeout duration in milliseconds. + * @property {boolean} [constrainResolution=false] When using a trackpad or + * magic mouse, zoom to the closest integer zoom level after the scroll gesture + * ends. + * @property {boolean} [useAnchor=true] Enable zooming using the mouse's + * location as the anchor. When set to `false`, zooming in and out will zoom to + * the center of the screen instead of zooming on the mouse's location. + */ + + /** * @classdesc * Allows the user to zoom the map by scrolling the mouse wheel. * * @constructor - * @extends {ol.interaction.Interaction} - * @param {olx.interaction.MouseWheelZoomOptions=} opt_options Options. + * @extends {module:ol/interaction/Interaction~Interaction} + * @param {module:olx/interaction/MouseWheelZoom~Options=} opt_options Options. * @api */ const MouseWheelZoom = function(opt_options) { @@ -100,7 +117,7 @@ const MouseWheelZoom = function(opt_options) { /** * @private - * @type {ol.interaction.Mode|undefined} + * @type {module:ol/interaction/MouseWheelZoom~Mode|undefined} */ this.mode_ = undefined; @@ -140,7 +157,7 @@ inherits(MouseWheelZoom, Interaction); * mousewheel-event) and eventually zooms the map. * @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} Allow event propagation. - * @this {ol.interaction.MouseWheelZoom} + * @this {module:ol/interaction/MouseWheelZoom~MouseWheelZoom} */ function handleEvent(mapBrowserEvent) { if (!this.condition_(mapBrowserEvent)) { @@ -271,7 +288,7 @@ MouseWheelZoom.prototype.decrementInteractingHint_ = function() { /** * @private - * @param {ol.PluggableMap} map Map. + * @param {module:ol/PluggableMap~PluggableMap} map Map. */ MouseWheelZoom.prototype.handleWheelZoom_ = function(map) { const view = map.getView();