mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-16 16:45:22 +00:00
user _limitZoom in flyTo, like we do in resetView (#9025)
Co-authored-by: Florian Bischof <design.falke@gmail.com>
This commit is contained in:
@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user