Resolve constraints for View#animate() API calls

This commit is contained in:
ahocevar
2019-04-05 17:13:55 +02:00
parent 0f73f16cfa
commit 070c1ec029
4 changed files with 18 additions and 16 deletions

View File

@@ -111,7 +111,7 @@ export function pan(view, delta, opt_duration) {
const currentCenter = view.getCenter();
if (currentCenter) {
const center = [currentCenter[0] + delta[0], currentCenter[1] + delta[1]];
view.animate({
view.animate_({
duration: opt_duration !== undefined ? opt_duration : 250,
easing: linear,
center: view.getConstrainedCenter(center)
@@ -135,7 +135,6 @@ export function zoomByDelta(view, delta, opt_anchor, opt_duration) {
const newZoom = view.getConstrainedZoom(currentZoom + delta);
const newResolution = view.getResolutionForZoom(newZoom);
view.resolveConstraints(0);
if (view.getAnimating()) {
view.cancelAnimations();
}