Handle event coordinate in the user projection

This commit is contained in:
Tim Schaub
2019-09-26 15:21:26 +02:00
parent 1e27846d6d
commit 5d4e77151c
6 changed files with 110 additions and 6 deletions

View File

@@ -91,7 +91,7 @@ class DragRotateAndZoom extends PointerInteraction {
}
this.lastAngle_ = theta;
if (this.lastMagnitude_ !== undefined) {
view.adjustResolution(this.lastMagnitude_ / magnitude);
view.adjustResolutionInternal(this.lastMagnitude_ / magnitude);
}
if (this.lastMagnitude_ !== undefined) {
this.lastScaleDelta_ = this.lastMagnitude_ / magnitude;

View File

@@ -122,7 +122,7 @@ export function pan(view, delta, opt_duration) {
/**
* @param {import("../View.js").default} view View.
* @param {number} delta Delta from previous zoom level.
* @param {import("../coordinate.js").Coordinate=} opt_anchor Anchor coordinate.
* @param {import("../coordinate.js").Coordinate=} opt_anchor Anchor coordinate in the user projection.
* @param {number=} opt_duration Duration.
*/
export function zoomByDelta(view, delta, opt_anchor, opt_duration) {
@@ -138,7 +138,7 @@ export function zoomByDelta(view, delta, opt_anchor, opt_duration) {
if (view.getAnimating()) {
view.cancelAnimations();
}
view.animateInternal({
view.animate({
resolution: newResolution,
anchor: opt_anchor,
duration: opt_duration !== undefined ? opt_duration : 250,

View File

@@ -95,7 +95,7 @@ class PinchZoom extends PointerInteraction {
// scale, bypass the resolution constraint
map.render();
view.adjustResolution(scaleDelta, this.anchor_);
view.adjustResolutionInternal(scaleDelta, this.anchor_);
}
/**