Use extends, super and proper constructor jsdoc for ol/interaction

This commit is contained in:
ahocevar
2018-07-17 21:09:06 +02:00
parent fd962caa1c
commit e79add2e77
20 changed files with 273 additions and 402 deletions

View File

@@ -1,7 +1,6 @@
/**
* @module ol/interaction/PinchRotate
*/
import {inherits} from '../util.js';
import ViewHint from '../ViewHint.js';
import {FALSE} from '../functions.js';
import {rotate, rotateWithoutConstraints} from '../interaction/Interaction.js';
@@ -21,20 +20,19 @@ import {disable} from '../rotationconstraint.js';
* @classdesc
* Allows the user to rotate the map by twisting with two fingers
* on a touch screen.
*
* @constructor
* @extends {module:ol/interaction/Pointer}
* @param {module:ol/interaction/PinchRotate~Options=} opt_options Options.
* @api
*/
class PinchRotate {
class PinchRotate extends PointerInteraction {
/**
* @param {module:ol/interaction/PinchRotate~Options=} opt_options Options.
* @api
*/
constructor(opt_options) {
PointerInteraction.call(this, {
super({
handleDownEvent: handleDownEvent,
handleDragEvent: handleDragEvent,
handleUpEvent: handleUpEvent
handleUpEvent: handleUpEvent,
stopDown: FALSE
});
const options = opt_options || {};
@@ -79,8 +77,6 @@ class PinchRotate {
}
inherits(PinchRotate, PointerInteraction);
/**
* @param {module:ol/MapBrowserPointerEvent} mapBrowserEvent Event.
@@ -174,10 +170,4 @@ function handleDownEvent(mapBrowserEvent) {
}
}
/**
* @inheritDoc
*/
PinchRotate.prototype.shouldStopEvent = FALSE;
export default PinchRotate;