diff --git a/externs/olx.js b/externs/olx.js index 0366d4ad1c..6a0b21326b 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -5,31 +5,6 @@ let olx; -/** - * @typedef {{condition: (ol.EventsConditionType|undefined), - * kinetic: (ol.Kinetic|undefined)}} - */ -olx.interaction.DragPanOptions; - - -/** - * 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.noModifierKeys}. - * @type {ol.EventsConditionType|undefined} - * @api - */ -olx.interaction.DragPanOptions.prototype.condition; - - -/** - * Kinetic inertia to apply to the pan. - * @type {ol.Kinetic|undefined} - * @api - */ -olx.interaction.DragPanOptions.prototype.kinetic; - - /** * @typedef {{condition: (ol.EventsConditionType|undefined), * duration: (number|undefined)}} diff --git a/externs/xol.js b/externs/xol.js index b6ccfff443..9dfa27601f 100644 --- a/externs/xol.js +++ b/externs/xol.js @@ -1,13 +1,4 @@ -/** - * @typedef {Object} interaction_DragPanOptions - * @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.noModifierKeys}. - * @property {ol.Kinetic|undefined} kinetic Kinetic inertia to apply to the pan. - */ - - /** * @typedef {Object} interaction_DragRotateAndZoomOptions * @property {ol.EventsConditionType|undefined} condition A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean diff --git a/src/ol/interaction/DragPan.js b/src/ol/interaction/DragPan.js index d575d13a84..dc4af231e9 100644 --- a/src/ol/interaction/DragPan.js +++ b/src/ol/interaction/DragPan.js @@ -9,13 +9,23 @@ import {noModifierKeys} from '../events/condition.js'; import {FALSE} from '../functions.js'; import PointerInteraction, {centroid as centroidFromPointers} from '../interaction/Pointer.js'; + +/** + * @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~noModifierKeys}. + * @property {module:ol/Kinetic~Kinetic} [kinetic] Kinetic inertia to apply to the pan. + */ + + /** * @classdesc * Allows the user to pan the map by dragging the map. * * @constructor - * @extends {ol.interaction.Pointer} - * @param {olx.interaction.DragPanOptions=} opt_options Options. + * @extends {module:ol/interaction/Pointer~Pointer} + * @param {module:ol/interaction/DragPan~Options=} opt_options Options. * @api */ const DragPan = function(opt_options) { @@ -30,7 +40,7 @@ const DragPan = function(opt_options) { /** * @private - * @type {ol.Kinetic|undefined} + * @type {module:ol/Kinetic~Kinetic|undefined} */ this.kinetic_ = options.kinetic; @@ -62,8 +72,8 @@ inherits(DragPan, PointerInteraction); /** - * @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event. - * @this {ol.interaction.DragPan} + * @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} mapBrowserEvent Event. + * @this {module:ol/interaction/DragPan~DragPan} */ function handleDragEvent(mapBrowserEvent) { const targetPointers = this.targetPointers; @@ -95,9 +105,9 @@ function handleDragEvent(mapBrowserEvent) { /** - * @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event. + * @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} mapBrowserEvent Event. * @return {boolean} Stop drag sequence? - * @this {ol.interaction.DragPan} + * @this {module:ol/interaction/DragPan~DragPan} */ function handleUpEvent(mapBrowserEvent) { const map = mapBrowserEvent.map; @@ -133,9 +143,9 @@ function handleUpEvent(mapBrowserEvent) { /** - * @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event. + * @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} mapBrowserEvent Event. * @return {boolean} Start drag sequence? - * @this {ol.interaction.DragPan} + * @this {module:ol/interaction/DragPan~DragPan} */ function handleDownEvent(mapBrowserEvent) { if (this.targetPointers.length > 0 && this.condition_(mapBrowserEvent)) {