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

Showing accuracy for forced location #572

Merged
merged 1 commit into from
Jul 6, 2018

Conversation

LukasPaczos
Copy link
Contributor

@LukasPaczos LukasPaczos commented Jul 4, 2018

Refs #469.

@LukasPaczos LukasPaczos added the location-layer-plugin Issues that deal with the location layer module label Jul 4, 2018
@LukasPaczos LukasPaczos added this to the location-layer-0.6.0 milestone Jul 4, 2018
@LukasPaczos LukasPaczos requested a review from danesfeder July 4, 2018 14:28
@LukasPaczos
Copy link
Contributor Author

I initially misinterpreted #469 - it points out that accuracy circle doesn't animate when the new location (with different accuracy than previous) is provided, it just jumps to the required value.

#469 (comment) still stands and is fixed by this PR.

@LukasPaczos LukasPaczos force-pushed the 469-accuracy-layer-improvements branch from be99028 to 597afe5 Compare July 4, 2018 15:21
Copy link
Contributor

@danesfeder danesfeder left a comment

Choose a reason for hiding this comment

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

@LukasPaczos just a clarifying comment. Per #572 (comment), you're saying the animation from different accuracies is fixed, but animate when the new location (with different accuracy than previous) is provided is still an issue? Thanks for running with this!

return locationEngine != null ? locationEngine.getLastLocation() : null;
Location location = locationEngine != null ? locationEngine.getLastLocation() : null;
if (location == null) {
location = lastLocation;
Copy link
Contributor

Choose a reason for hiding this comment

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

@LukasPaczos Per javadoc above - here we are trying to get the last known location from the location engine and if nothing is found, using lastLocation which could also possibly be null? Just clarifying here, I think it makes sense to add the extra check in case a developer was forcing Location updates.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, lastLocation can also be null if no updates have been pushed to the plugin yet. This is our last resort if locationEngine is null or fails to provide non-null location, like a scenario when we are only forcing location updates.

The idea here is, that LocationEngine can be in a position to provide last location (or just more recent location) even if no location updates have been pushed to the plugin itself.

@LukasPaczos
Copy link
Contributor Author

you're saying the animation from different accuracies is fixed

Unfortunately, no. This is something I'm working on right now. This PR fixes an issue which occurred when you didn't use locationEngine (only forcing location updates) and zoomed in/out - then accuracy would be gone. We are using getLastKnownLocation to recalculate the radius for a new zoom level, and it would always return null, because there was no engine. Now we have lastLocation variable to fall back to.

Copy link
Contributor

@danesfeder danesfeder left a comment

Choose a reason for hiding this comment

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

@LukasPaczos got it, thanks for clarifying - 🚢 ✅

@LukasPaczos LukasPaczos force-pushed the 558-native-crash-on-style-reload branch from 4bad0d6 to d11b44f Compare July 6, 2018 11:16
@LukasPaczos LukasPaczos changed the base branch from 558-native-crash-on-style-reload to master July 6, 2018 12:01
@LukasPaczos LukasPaczos force-pushed the 469-accuracy-layer-improvements branch from 597afe5 to 56ea346 Compare July 6, 2018 12:03
@LukasPaczos LukasPaczos merged commit bed726e into master Jul 6, 2018
@LukasPaczos LukasPaczos deleted the 469-accuracy-layer-improvements branch July 6, 2018 12:32
@danesfeder danesfeder mentioned this pull request Jul 9, 2018
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
location-layer-plugin Issues that deal with the location layer module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants