-
-
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
Fix bounds
Issue (for #1362)
#1369
Conversation
I will try to have a look into this tomorrow when I get a moment, as this is high priority. Just to note, I'm not totally happy with bounds and things either, so maybe @moonag or @TesteurManiak want to have a look. |
bounds
Issue (for #1362)
This is probably fine. The logic of fitbounds can probably be refactored to get the state to apply before the first build. Not sure why it wouldn't apply from setState though. I would have to look further. I don't have the time to right now, but this change probably won't severely break things. I have not tested this change, just looked at the code. |
Would prefer others to test really on this one, as there may be some edge cases I haven't thought of, especially with initialisation and timing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. It's resolved the issue, and I cannot see why it would have side effects.
Great, thanks. |
Possible fix for the recent
bounds
issue. Needs proper testing before merging as I'm not quite familiar with bounds and recent changes.What this does is remove the fitBounds in the build method (I'm not sure this is needed there at all, as long as its run once?), and move it just to the initState (but it looks like it needs to run in the WidgetsBinding.instance.addPostFrameCallback for it to take effect...I'm not entirely sure if this is best or if its better before/after options.onMapReady?.call()).
Few thoughts...should
bounds
(I think we should think of it as initialFitBounds if my understanding of it is correct, and maybe rename one day) only run here...are there any other situations when we need to reset bounds ? Are there any possible race conditions where this is in the wrong place.We can test the basics with something like this in one of the examples...