Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally set max zoom level in zoomToVectors() and zoomToLayer() methods #169

Open
mstenta opened this issue Jun 18, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@mstenta
Copy link
Member

mstenta commented Jun 18, 2022

When using the instance.zoomToVectors() and instance.zoomToLayer() methods, there is currently no control over the maximum zoom level. When the vector/layer contains a single point this results in a zoom that is far too close to be useful, forcing the user to manually zoom out to see where they are. This isn't as much of an issue with line/polygon geometries, which are more common.

@mstenta mstenta added the enhancement New feature or request label Jun 18, 2022
@paul121
Copy link
Member

paul121 commented Aug 8, 2022

This is related to #95, although slightly different. Being able to configure both the padding and maxZoom of the fit options would be wonderful!

const fitOptions = {
size: this.map.getSize(),
padding: [20, 20, 20, 20],
maxZoom: 20,
};
this.map.getView().fit(extent, fitOptions);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants