No olx and ol types for ol/interaction/PinchRotate

This commit is contained in:
ahocevar
2018-03-16 16:38:48 +01:00
parent 54beb17b55
commit 998b8df55d
3 changed files with 17 additions and 37 deletions

View File

@@ -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),

View File

@@ -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`.

View File

@@ -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) {