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

fixed exception during initialization #379

Merged
merged 2 commits into from
Jul 31, 2019

Conversation

escamoteur
Copy link
Contributor

Hi,

I observed that when you have enabled 'break on all exceptions' that flutter_map threw an exception while initializing due to that _lastCenter was not initialized. I changed a little bit the sequence and made sure that in this case move is executed which initializes _lastCenter correctly.

IMHO it would be worth to have a closer look over the whole initialization process sometimes.

@@ -115,7 +115,7 @@ class MapState {
zoom = _fitZoomToBounds(zoom);
final mapMoved = center != _lastCenter || zoom != _zoom;

if (!mapMoved || options.isOutOfBounds(center) || !bounds.isValid) {
if (_lastCenter != null && (!mapMoved || options.isOutOfBounds(center) || !bounds.isValid)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file needs to be formatted - can you run dartfmt?

@escamoteur
Copy link
Contributor Author

Done

@johnpryan johnpryan merged commit ec010aa into fleaflet:master Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants