Skip to content

Added center map and fixed compile error#76

Open
gusrod-coder wants to merge 2 commits intomaizebus-2.1from
Center-on-start
Open

Added center map and fixed compile error#76
gusrod-coder wants to merge 2 commits intomaizebus-2.1from
Center-on-start

Conversation

@gusrod-coder
Copy link

Added centering for map (on app start, or directly after the user declares that they will allow location tracking) - Edited build gradle and settings gradle to remove compiling error (kotlin 2.3 instead of 2.1).

Added centering for map (on app start, or directly after the user declares that they will allow location tracking) - Edited build gradle and settings gradle to remove compiling error (kotlin 2.3 instead of 2.1).
Copy link
Member

@TheStaticBits TheStaticBits left a comment

Choose a reason for hiding this comment

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

you've created an infinite centerOnLocation loop -- make sure to run and test your features before creating a pull request. See comments for more details

}

Position? position = await Geolocator.getLastKnownPosition();
_centerOnLocation(true);
Copy link
Member

Choose a reason for hiding this comment

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

_centerOnLocation calls _getLastKnownLocation, creating an infinite loop.

@TheStaticBits TheStaticBits linked an issue Mar 23, 2026 that may be closed by this pull request
Removed unneccessary comments and reimplemented location centering immediately after location permissions are provided to avoid infinite centering loop
@gusrod-coder
Copy link
Author

Moved the center on location call to avoid infinite loops - Now will center once after user changes their geolocator permission from denied to allowed or on app open

Copy link
Member

@TheStaticBits TheStaticBits left a comment

Choose a reason for hiding this comment

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

looks all good to me, aside from some buggy center-looping behavior when the user denies permissions -- but I think fixing the experience of using the app with location permissions denied should be another task entirely, since right now it spams the "location perms denied" banner regardless of this particular pull request. I'll approve this if @i-kumar is alright with it

@kurz3m3 kurz3m3 requested a review from i-kumar March 24, 2026 17:21
@i-kumar
Copy link
Member

i-kumar commented Mar 24, 2026

checking it now

Copy link
Member

@i-kumar i-kumar left a comment

Choose a reason for hiding this comment

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

Nope. Not the behavior we want. The centering after accepting location permissions for the first time is fine. But for the normal case, make it so that the map is centered when the map is loaded. If the app loads, and then the map animates there, it looks odd.

Right now the map is set to default center on ann arbor. You'll have to change that. And you'll have to write the call to find the location in the loading sequence (in _loadAllData()).

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.

Center Map on Launch

3 participants