user _limitZoom in flyTo, like we do in resetView (#9025)

Co-authored-by: Florian Bischof <design.falke@gmail.com>
This commit is contained in:
Yohan Boniface
2023-07-12 20:52:52 +02:00
committed by GitHub
parent 1269e1622a
commit 2592967aa6
2 changed files with 17 additions and 1 deletions

View File

@ -1418,6 +1418,22 @@ describe('Map', () => {
map.flyTo(dc, 4, {duration: 0.1});
});
it('flyTo should honour maxZoom', (done) => {
const newCenter = latLng(10, 11),
maxZoom = 20;
map.options.maxZoom = maxZoom;
map.setView([0, 0], 0);
map.on('zoomend', () => {
expect(map.getCenter()).to.eql(newCenter);
expect(map.getZoom()).to.eql(maxZoom);
done();
});
map.flyTo(newCenter, 22, {animate: true, duration: 0.1});
});
});
describe('#zoomIn and #zoomOut', () => {