From 998b8df55d6b1769fdf87d95a42210a05ce12510 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Fri, 16 Mar 2018 16:38:48 +0100 Subject: [PATCH] No olx and ol types for ol/interaction/PinchRotate --- externs/olx.js | 22 ---------------------- externs/xol.js | 7 ------- src/ol/interaction/PinchRotate.js | 25 +++++++++++++++++-------- 3 files changed, 17 insertions(+), 37 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 91049d7314..3fb7741c83 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -47,28 +47,6 @@ olx.interaction.TranslateOptions.prototype.hitTolerance; /** - * @typedef {{threshold: (number|undefined), - * duration: (number|undefined)}} - */ -olx.interaction.PinchRotateOptions; - - -/** - * The duration of the animation in milliseconds. Default is `250`. - * @type {number|undefined} - * @api - */ -olx.interaction.PinchRotateOptions.prototype.duration; - - -/** - * Minimal angle in radians to start a rotation. Default is `0.3`. - * @type {number|undefined} - * @api - */ -olx.interaction.PinchRotateOptions.prototype.threshold; - - /** * @typedef {{ * duration: (number|undefined), diff --git a/externs/xol.js b/externs/xol.js index 7b38e3eedd..112e9ded51 100644 --- a/externs/xol.js +++ b/externs/xol.js @@ -14,13 +14,6 @@ */ -/** - * @typedef {Object} interaction_PinchRotateOptions - * @property {number|undefined} duration The duration of the animation in milliseconds. Default is `250`. - * @property {number|undefined} threshold Minimal angle in radians to start a rotation. Default is `0.3`. - */ - - /** * @typedef {Object} interaction_PinchZoomOptions * @property {number|undefined} duration Animation duration in milliseconds. Default is `400`. diff --git a/src/ol/interaction/PinchRotate.js b/src/ol/interaction/PinchRotate.js index 2b3d10670f..b016c664d1 100644 --- a/src/ol/interaction/PinchRotate.js +++ b/src/ol/interaction/PinchRotate.js @@ -8,14 +8,23 @@ import {rotate, rotateWithoutConstraints} from '../interaction/Interaction.js'; import PointerInteraction, {centroid as centroidFromPointers} from '../interaction/Pointer.js'; import {disable} from '../rotationconstraint.js'; + +/** + * @typedef {Object} Options + * @property {number} [duration=250] The duration of the animation in + * milliseconds. + * @property {number} [threshold=0.3] Minimal angle in radians to start a rotation. + */ + + /** * @classdesc * Allows the user to rotate the map by twisting with two fingers * on a touch screen. * * @constructor - * @extends {ol.interaction.Pointer} - * @param {olx.interaction.PinchRotateOptions=} opt_options Options. + * @extends {module:ol/interaction/Pointer~Pointer} + * @param {module:ol/interaction/PinchRotate~Options=} opt_options Options. * @api */ const PinchRotate = function(opt_options) { @@ -70,8 +79,8 @@ inherits(PinchRotate, PointerInteraction); /** - * @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event. - * @this {ol.interaction.PinchRotate} + * @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} mapBrowserEvent Event. + * @this {module:ol/interaction/PinchRotate~PinchRotate} */ function handleDragEvent(mapBrowserEvent) { let rotationDelta = 0.0; @@ -120,9 +129,9 @@ function handleDragEvent(mapBrowserEvent) { /** - * @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event. + * @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} mapBrowserEvent Event. * @return {boolean} Stop drag sequence? - * @this {ol.interaction.PinchRotate} + * @this {module:ol/interaction/PinchRotate~PinchRotate} */ function handleUpEvent(mapBrowserEvent) { if (this.targetPointers.length < 2) { @@ -141,9 +150,9 @@ function handleUpEvent(mapBrowserEvent) { /** - * @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event. + * @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} mapBrowserEvent Event. * @return {boolean} Start drag sequence? - * @this {ol.interaction.PinchRotate} + * @this {module:ol/interaction/PinchRotate~PinchRotate} */ function handleDownEvent(mapBrowserEvent) { if (this.targetPointers.length >= 2) {