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

[BUG] v6: New default constraints cause trapped zooms on different screen sizes #1699

Closed
mattmyne opened this issue Oct 21, 2023 · 4 comments · Fixed by #1700
Closed

[BUG] v6: New default constraints cause trapped zooms on different screen sizes #1699

mattmyne opened this issue Oct 21, 2023 · 4 comments · Fixed by #1700
Labels
bug This issue reports broken functionality or another error P: 2 (soon™?)

Comments

@mattmyne
Copy link

What is the bug?

In my MapOptions I include:

initialZoom: 1.5, minZoom: 1.5,

In v5.0.0 this worked as expected.
In v6.0.0:

Seems to work as expected on Android emulator.
On Chrome, it allows further zoom in but cannot zoom out until zoom level is greater than 3 (and then only allows zoom down to 3, not 1.5 requested).
On Windows 11 (x64) zoom is frozen - cannot zoom in or out - if initialZoom set below 3.
I've not tested on macOS/iOS.

Setting minZoom to a value greater or equal to 3 works as expected (doesn't allow zoom less than whatever it's set to) on all platforms tested.

It seems like minZoom is internally limited to no less than 3?

I've tried changing minNativeZoom and minZoom on the TileLayer but this has no effect (given they both default to zero anyway this is unsurprising).

How can we reproduce it?

Set initialZoom and/or minZoom to a value less than 3 in MapOptions and try and zoom on affected platforms.

Do you have a potential solution?

No response

Platforms

Windows 11 (x64), Edge, Android Emulator

Severity

Obtrusive: Prevents normal functioning but causes no errors in the console

@mattmyne mattmyne added bug This issue reports broken functionality or another error needs triage This new bug report needs reproducing and prioritizing labels Oct 21, 2023
@mattmyne mattmyne changed the title [BUG] minZoom cannot be below 3 in v6.0.0? [BUG] minZoom cannot be below 2 in v6.0.0? Oct 21, 2023
@mattmyne
Copy link
Author

Sorry, it seems it cannot be below 2 - not 3

@JaffaKetchup
Copy link
Member

I'm assuming this is todo with display size, and therefore #1682.

@JaffaKetchup JaffaKetchup added P: 2 (soon™?) and removed needs triage This new bug report needs reproducing and prioritizing labels Oct 23, 2023
@JaffaKetchup JaffaKetchup changed the title [BUG] minZoom cannot be below 2 in v6.0.0? [BUG] v6: New default constraints causes trapped zooms on different screen sizes Oct 23, 2023
@JaffaKetchup JaffaKetchup changed the title [BUG] v6: New default constraints causes trapped zooms on different screen sizes [BUG] v6: New default constraints cause trapped zooms on different screen sizes Oct 23, 2023
@mattmyne
Copy link
Author

I'm assuming this is todo with display size, and therefore #1682.

Yes, good spot! I can confirm adding:
cameraConstraint: const CameraConstraint.unconstrained(),
to my MapOptions fixes the issue.

Perhaps keeping camera constraints disabled by default is the way to go after all, since having zoom levels that don't work is going to lead to confusion.

@JaffaKetchup
Copy link
Member

Yep, I've opened #1682 to revert this commit. I didn't release it would cause so many issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error P: 2 (soon™?)
Projects
None yet
2 participants