Only zoom out, not in, when fitting ways/relations

This commit is contained in:
2026-02-24 22:27:52 +04:00
parent ee5e56910d
commit 34bc15cfa9

View File

@@ -524,11 +524,13 @@ export default class MapComponent extends Component {
padding[1] = visibleWidth * 0.15; padding[1] = visibleWidth * 0.15;
} }
const currentZoom = view.getZoom();
view.fit(extent, { view.fit(extent, {
padding: padding, padding: padding,
duration: 1000, duration: 1000,
easing: (t) => t * (2 - t), easing: (t) => t * (2 - t),
maxZoom: 19, maxZoom: currentZoom,
}); });
} }