Skip to content

Commit

Permalink
Remove force center after view animation.
Browse files Browse the repository at this point in the history
This workaround was making the map less blury in case of map height with a not
round number of pixels, but it cause the map zoom to "jump" if the
view.contrainResolution is set to true.
  • Loading branch information
ger-benjamin committed Nov 26, 2024
1 parent 2f2bb97 commit 0200a62
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/controllers/AbstractAppController.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export function AbstractAppController($scope, $injector, mobile) {
}
}
const scaleline = document.getElementById('scaleline');

const view = new olView(this.options.view);
const constraints = view.getConstraints();
const centerConstraint = constraints.center;
Expand Down Expand Up @@ -126,15 +127,6 @@ export function AbstractAppController($scope, $injector, mobile) {
}
return newCenter;
};

// Fix the center on the WMTS grid on animation end
const originalViewSetHint = view.setHint;
view.setHint = (hint, value) => {
originalViewSetHint.call(view, hint, value);
if (hint === ViewHint.ANIMATING && value === -1) {
view.setCenter(view.getCenter());
}
};
const map = new olMap(
Object.assign(
{
Expand Down

0 comments on commit 0200a62

Please sign in to comment.