No olx and ol types for ol/interaction/PinchZoom

This commit is contained in:
ahocevar
2018-03-16 16:42:34 +01:00
parent 998b8df55d
commit 89f6d74696
3 changed files with 17 additions and 40 deletions

View File

@@ -46,31 +46,6 @@ olx.interaction.TranslateOptions.prototype.layers;
olx.interaction.TranslateOptions.prototype.hitTolerance;
/**
/**
* @typedef {{
* duration: (number|undefined),
* constrainResolution: (boolean|undefined)
* }}
*/
olx.interaction.PinchZoomOptions;
/**
* Animation duration in milliseconds. Default is `400`.
* @type {number|undefined}
* @api
*/
olx.interaction.PinchZoomOptions.prototype.duration;
/**
* Zoom to the closest integer zoom level after the pinch gesture ends. Default is `false`.
* @type {boolean|undefined}
* @api
*/
olx.interaction.PinchZoomOptions.prototype.constrainResolution;
/**
* @typedef {{handleDownEvent: (function(ol.MapBrowserPointerEvent):boolean|undefined),
* handleDragEvent: (function(ol.MapBrowserPointerEvent)|undefined),

View File

@@ -14,13 +14,6 @@
*/
/**
* @typedef {Object} interaction_PinchZoomOptions
* @property {number|undefined} duration Animation duration in milliseconds. Default is `400`.
* @property {boolean|undefined} constrainResolution Zoom to the closest integer zoom level after the pinch gesture ends. Default is `false`.
*/
/**
* @typedef {Object} interaction_PointerOptions
* @property {(function(ol.MapBrowserPointerEvent):boolean|undefined)} handleDownEvent Function handling "down" events. If the function returns `true` then a drag

View File

@@ -7,14 +7,23 @@ import {FALSE} from '../functions.js';
import {zoom, zoomWithoutConstraints} from '../interaction/Interaction.js';
import PointerInteraction, {centroid as centroidFromPointers} from '../interaction/Pointer.js';
/**
* @typedef {Object} Options
* @property {number} [duration=400] Animation duration in milliseconds.
* @property {boolean} [constrainResolution=false] Zoom to the closest integer
* zoom level after the pinch gesture ends.
*/
/**
* @classdesc
* Allows the user to zoom the map by pinching with two fingers
* on a touch screen.
*
* @constructor
* @extends {ol.interaction.Pointer}
* @param {olx.interaction.PinchZoomOptions=} opt_options Options.
* @extends {module:ol/interaction/Pointer~Pointer}
* @param {module:ol/interaction/PinchZoom~Options=} opt_options Options.
* @api
*/
const PinchZoom = function(opt_options) {
@@ -63,8 +72,8 @@ inherits(PinchZoom, PointerInteraction);
/**
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
* @this {ol.interaction.PinchZoom}
* @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} mapBrowserEvent Event.
* @this {module:ol/interaction/PinchZoom~PinchZoom}
*/
function handleDragEvent(mapBrowserEvent) {
let scaleDelta = 1.0;
@@ -115,9 +124,9 @@ function handleDragEvent(mapBrowserEvent) {
/**
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
* @param {module:ol/MapBrowserPointerEvent~MapBrowserPointerEvent} mapBrowserEvent Event.
* @return {boolean} Stop drag sequence?
* @this {ol.interaction.PinchZoom}
* @this {module:ol/interaction/PinchZoom~PinchZoom}
*/
function handleUpEvent(mapBrowserEvent) {
if (this.targetPointers.length < 2) {
@@ -142,9 +151,9 @@ function handleUpEvent(mapBrowserEvent) {
/**
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
* @param {module:ol/MapBrowserPointerEvent/MapBrowserPointerEvent} mapBrowserEvent Event.
* @return {boolean} Start drag sequence?
* @this {ol.interaction.PinchZoom}
* @this {module:ol/interaction/PinchZoom~PinchZoom}
*/
function handleDownEvent(mapBrowserEvent) {
if (this.targetPointers.length >= 2) {