Open JosefWN opened 2 years ago
Hi @JosefWN, @TesteurManiak (a maintainer) is having problems reproducing your issue. Can you send a minimal reproducible example please? Many thanks!
Yeah, just to give a bit more context here's my sample:
I've tested on MacOS and iOS and was not able to reproduce this exception either by using the MapController
or the gestures.
My guess would be the initial problem is using a custom crs and not providing the relevant resolution or something ?
My guess would be the initial problem is using a custom crs and not providing the relevant resolution or something ?
Yes, exactly. Sorry for the brief description, thought it was a broader problem, although I hadn't seen it until recently. My code actually looks very similar to the EPSG:3413 example.
The problem is with the touch gestures on macOS introduced in Flutter 3.3.0, if I pinch to zoom out the error occurs in that example too.
Reinstalled Flutter just in case:
brew update
brew uninstall flutter
brew cleanup
brew install flutter # 3.3.0
In the example/
folder on flutter_map/master
:
flutter clean
flutter pub get
flutter create --platforms=macos .
# Add entitlement com.apple.security.network.client
flutter run -d macos
Go to the example "EPSG3413 CRS", then use "pinch to zoom" to zoom out as far as possible. So not just one pinch gesture, it takes several. This is what I get:
Yes, we've kind of been here before. The problem is one should set the minZoom/maxZoom to match the resolutions (we did ponder creating a power of 2 multiplier/divisor for ones that don't exist.
Worth a read of https://github.com/fleaflet/flutter_map/issues/1223
The example should probably have min/maxZooms or relevant resolutions added. Whether there's a "safe" fix for all crs & resolutions that may not be there, I'm not much of an expert in that area.
But maxZoom
is a little different, isn't minZoom
always equal to or greater than zero? At least with a resolutions list we couldn't possibly index resolutions[-1]
since negative indices are not not valid in Dart.
Even if we could have a minZoom < 0
I'm just arguing that setting the default to 0 might be preferable, and let users override with negative min values if they are in need of those. That way we avoid surprises with index out of bounds on the negative end.
Yes, I don't have an issue with that (but the same issue with zoom greater than resolutions index will still exist I think).
Yes, but that's a bit more intuitive to provide. We could perhaps store and expose the resolutions list in the relevant Crs
(such as Proj4Crs
)? Then the default could be to bound/clamp zoom to the array indices in the list.
Yes, I think that makes sense, and was thinking along those lines, just haven't had chance to poke about with any of it, and not as confident with the custom crs stuff (so pull requests as ever welcome!).
I might be able to take a look in the coming month, a bit tight on time right now!
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
What is the bug?
I get the following exception when zooming out as far as possible without explicitly setting
minZoom
to 0:What is the expected behaviour?
I would expect the default for
minZoom
to be 0 if not set (or make the parameter required, if it is).How can we reproduce this issue?
Do you have a potential solution?
No response
Can you provide any other information?
This is on
flutter_map
3.0.0.Platforms Affected
MacOS
Severity
Minimum: Allows normal functioning
Frequency
Consistently: Always occurs at the same time and location
Requirements
flutter doctor
finds no relevant issues