Merge pull request #10865 from jahow/view-animate-updatesize-fix

View / avoid solving constraints related to map size during animation
This commit is contained in:
Olivier Guyot
2020-04-03 13:55:54 +02:00
committed by GitHub
3 changed files with 53 additions and 2 deletions

View File

@@ -1090,6 +1090,54 @@ describe('ol.View', function() {
});
it('completes even though Map#setSize is called', function(done) {
const view = new View({
center: [0, 0],
zoom: 0
});
const map = new Map({
view
});
map.setSize([110, 90]);
view.animate({
zoom: 1,
duration: 25
}, function() {
expect(view.getZoom()).to.be(1);
done();
});
setTimeout(function() {
map.setSize([100, 100]);
}, 10);
});
it('completes even though Map#updateSize is called', function(done) {
const view = new View({
center: [0, 0],
zoom: 0
});
const map = new Map({
view
});
view.animate({
zoom: 1,
duration: 25
}, function() {
expect(view.getZoom()).to.be(1);
done();
});
setTimeout(function() {
map.updateSize();
}, 10);
});
});
describe('#cancelAnimations()', function() {