-
-
Notifications
You must be signed in to change notification settings - Fork 860
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] 6.0.0-dev.2: Assertion false positive: "MapCamera is no longer within the cameraConstraint after an option change" #1613
Comments
This will ensure assertions like the one described in [this issue](fleaflet#1613) work as intended.
Turns out to be a relatively simple fix; I just had to implement |
This will ensure assertions like the one described in [this issue](fleaflet#1613) work as intended.
@JaffaKetchup The same issue if I'm using CameraConstraint.contain(). No problems, if it's CameraConstraint.containCenter() |
@DevTello If you're still getting this issue in v6.1.0, please open a new issue! |
I was getting the same exception, i had to adjust the initialCenter with respect to the cameraConstraints Like, For this above bounds it works perfectly with initialZoom of 2.3, if I go any less than this, its throws me again MapCamera, is not within cameraConstraint error. Here is my full code
|
What is the bug?
Hi all! I'm testing out some code on the pre-release
6.0.0-dev.2
version. Whenever I include a camera constraint in my map options, I get an assertion failure from lib/src/map/internal_controller.dart:My constraint is a
CameraConstraint.containCenter
constraint, and I've confirmed that the map center is indeed within the given constraint.How can we reproduce it?
Create a map with map options that include a camera constraint, but ensure the map options change after the initial build such that
FlutterMap
sdidUpdateWidget
is called with the new set of map options.Do you have a potential solution?
I may have missed it, but it doesn't seem as though
MapCamera
implementsoperator ==
, which may explain the issue (i.e. the assertion is essentially doing reference equality, which I think would always fail). If someone else is not already working on this then I could work on a PR to add it.cc @rorystephenson @JaffaKetchup
Platforms
Android, iOS
Severity
Erroneous: Prevents normal functioning and causes errors in the console
The text was updated successfully, but these errors were encountered: