Remove private static members from PinchZoom interaction
This commit is contained in:
@@ -20,9 +20,9 @@ import PointerInteraction from '../interaction/Pointer.js';
|
|||||||
const PinchZoom = function(opt_options) {
|
const PinchZoom = function(opt_options) {
|
||||||
|
|
||||||
PointerInteraction.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: PinchZoom.handleDownEvent_,
|
handleDownEvent: handleDownEvent,
|
||||||
handleDragEvent: PinchZoom.handleDragEvent_,
|
handleDragEvent: handleDragEvent,
|
||||||
handleUpEvent: PinchZoom.handleUpEvent_
|
handleUpEvent: handleUpEvent
|
||||||
});
|
});
|
||||||
|
|
||||||
const options = opt_options ? opt_options : {};
|
const options = opt_options ? opt_options : {};
|
||||||
@@ -65,9 +65,8 @@ inherits(PinchZoom, PointerInteraction);
|
|||||||
/**
|
/**
|
||||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||||
* @this {ol.interaction.PinchZoom}
|
* @this {ol.interaction.PinchZoom}
|
||||||
* @private
|
|
||||||
*/
|
*/
|
||||||
PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
function handleDragEvent(mapBrowserEvent) {
|
||||||
let scaleDelta = 1.0;
|
let scaleDelta = 1.0;
|
||||||
|
|
||||||
const touch0 = this.targetPointers[0];
|
const touch0 = this.targetPointers[0];
|
||||||
@@ -112,16 +111,15 @@ PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
|||||||
// scale, bypass the resolution constraint
|
// scale, bypass the resolution constraint
|
||||||
map.render();
|
map.render();
|
||||||
Interaction.zoomWithoutConstraints(view, newResolution, this.anchor_);
|
Interaction.zoomWithoutConstraints(view, newResolution, this.anchor_);
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||||
* @return {boolean} Stop drag sequence?
|
* @return {boolean} Stop drag sequence?
|
||||||
* @this {ol.interaction.PinchZoom}
|
* @this {ol.interaction.PinchZoom}
|
||||||
* @private
|
|
||||||
*/
|
*/
|
||||||
PinchZoom.handleUpEvent_ = function(mapBrowserEvent) {
|
function handleUpEvent(mapBrowserEvent) {
|
||||||
if (this.targetPointers.length < 2) {
|
if (this.targetPointers.length < 2) {
|
||||||
const map = mapBrowserEvent.map;
|
const map = mapBrowserEvent.map;
|
||||||
const view = map.getView();
|
const view = map.getView();
|
||||||
@@ -141,16 +139,15 @@ PinchZoom.handleUpEvent_ = function(mapBrowserEvent) {
|
|||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||||
* @return {boolean} Start drag sequence?
|
* @return {boolean} Start drag sequence?
|
||||||
* @this {ol.interaction.PinchZoom}
|
* @this {ol.interaction.PinchZoom}
|
||||||
* @private
|
|
||||||
*/
|
*/
|
||||||
PinchZoom.handleDownEvent_ = function(mapBrowserEvent) {
|
function handleDownEvent(mapBrowserEvent) {
|
||||||
if (this.targetPointers.length >= 2) {
|
if (this.targetPointers.length >= 2) {
|
||||||
const map = mapBrowserEvent.map;
|
const map = mapBrowserEvent.map;
|
||||||
this.anchor_ = null;
|
this.anchor_ = null;
|
||||||
@@ -163,7 +160,7 @@ PinchZoom.handleDownEvent_ = function(mapBrowserEvent) {
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user