View / better names for getValid* and applyParameters_ methods
This commit is contained in:
@@ -116,7 +116,7 @@ class DragPan extends PointerInteraction {
|
||||
centerpx[1] - distance * Math.sin(angle)
|
||||
]);
|
||||
view.animate({
|
||||
center: view.getValidCenter(dest),
|
||||
center: view.getConstrainedCenter(dest),
|
||||
duration: 500,
|
||||
easing: easeOut
|
||||
});
|
||||
|
||||
@@ -80,8 +80,8 @@ function onBoxEnd() {
|
||||
extent = mapExtent;
|
||||
}
|
||||
|
||||
const resolution = view.getValidResolution(view.getResolutionForExtent(extent, size));
|
||||
const center = view.getValidCenter(getCenter(extent), resolution);
|
||||
const resolution = view.getConstrainedResolution(view.getResolutionForExtent(extent, size));
|
||||
const center = view.getConstrainedCenter(getCenter(extent), resolution);
|
||||
|
||||
view.animate({
|
||||
resolution: resolution,
|
||||
|
||||
@@ -114,7 +114,7 @@ export function pan(view, delta, opt_duration) {
|
||||
view.animate({
|
||||
duration: opt_duration !== undefined ? opt_duration : 250,
|
||||
easing: linear,
|
||||
center: view.getValidCenter(center)
|
||||
center: view.getConstrainedCenter(center)
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ export function zoomByDelta(view, delta, opt_anchor, opt_duration) {
|
||||
return;
|
||||
}
|
||||
|
||||
const newZoom = view.getValidZoomLevel(currentZoom + delta);
|
||||
const newZoom = view.getConstrainedZoom(currentZoom + delta);
|
||||
const newResolution = view.getResolutionForZoom(newZoom);
|
||||
|
||||
if (view.getAnimating()) {
|
||||
|
||||
Reference in New Issue
Block a user