View / remove constrainCenter method

This commit is contained in:
jahow
2019-01-12 15:49:36 +01:00
committed by Olivier Guyot
parent c2c1aa01d3
commit d991dfa54a
5 changed files with 5 additions and 19 deletions

View File

@@ -111,8 +111,7 @@ class Interaction extends BaseObject {
export function pan(view, delta, opt_duration) {
const currentCenter = view.getCenter();
if (currentCenter) {
const center = view.constrainCenter(
[currentCenter[0] + delta[0], currentCenter[1] + delta[1]]);
const center = [currentCenter[0] + delta[0], currentCenter[1] + delta[1]];
if (opt_duration) {
view.animate({
duration: opt_duration,
@@ -209,8 +208,7 @@ export function zoomByDelta(view, delta, opt_anchor, opt_duration) {
// the constraint to it, and then calculate back the anchor
if (opt_anchor) {
const currentCenter = view.getCenter();
let center = view.calculateCenterZoom(newResolution, opt_anchor);
center = view.constrainCenter(center);
const center = view.calculateCenterZoom(newResolution, opt_anchor);
opt_anchor = [
(newResolution * currentCenter[0] - currentResolution * center[0]) /