Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Android jerky location updates from version 5.1.0 and up #9775

Closed
kkalera opened this issue Aug 15, 2017 · 4 comments
Closed

Android jerky location updates from version 5.1.0 and up #9775

kkalera opened this issue Aug 15, 2017 · 4 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@kkalera
Copy link

kkalera commented Aug 15, 2017

Hi, I recently updated from version 5.1.0-beta.2 to version 5.1.2. I had to change my code a bit because of new changes but previously location tracking was very smooth. Now the camera just pops to the new location.

I'm getting the user's location using the following code:
myMap.setMyLocationEnabled(true); myMap.getTrackingSettings().setDismissAllTrackingOnGesture(false); myMap.getTrackingSettings().setMyLocationTrackingMode(MyLocationTracking.TRACKING_FOLLOW); myMap.getTrackingSettings().setLocationChangeAnimationEnabled(true); myMap.getTrackingSettings().setMyBearingTrackingMode(MyBearingTracking.GPS);

@kkalera
Copy link
Author

kkalera commented Aug 15, 2017

I'm finding this also happens with older versions, guessing it's a problem with the code on my end.

@kkalera kkalera closed this as completed Aug 15, 2017
@kkalera
Copy link
Author

kkalera commented Aug 15, 2017

I've been doing some testing and the problem has arised again.

This is the code that I'm using in 5.1.0-beta.3:
locationEngine = LocationSource.getLocationEngine(this); locationEngine.activate(); myMap.setMyLocationEnabled(true); myMap.getTrackingSettings().setMyLocationTrackingMode(MyLocationTracking.TRACKING_FOLLOW); myMap.getTrackingSettings().setMyBearingTrackingMode(MyBearingTracking.GPS);

This results in a smooth camera following the user's location.

In version 5.1.0 and up I'm using this:
locationEngine = new LocationSource(this); locationEngine.activate(); myMap.setMyLocationEnabled(true); myMap.getTrackingSettings().setMyLocationTrackingMode(MyLocationTracking.TRACKING_FOLLOW); myMap.getTrackingSettings().setMyBearingTrackingMode(MyBearingTracking.GPS); myMap.getTrackingSettings().setLocationChangeAnimationEnabled(true);
Using the latter results in the camera instantly moving to the new location instead of making a smooth transition from the previous location to the new one.

@kkalera kkalera reopened this Aug 15, 2017
@tobrun tobrun added the Android Mapbox Maps SDK for Android label Aug 15, 2017
@tobrun
Copy link
Member

tobrun commented Aug 16, 2017

Thank you for the report. First of all, have you seen the LocationLayer plugin? We are deprecating MyLocationView in favor of this plugin in 5.2.0. (#9771).

Second, while I wasn't able to fully reproduce your described behavior (see gif below). I'm noticing that the flag for LocationChangeAnimationEnabled is default set to false, while it should be true. Will fix this up for 5.1.3. If possible could you attach a gif showing your issue?

ezgif com-video-to-gif 10

@kkalera
Copy link
Author

kkalera commented Aug 16, 2017

I've created a new activity to test this again and its working just fine. Looks like its some kind of bug in my other activity's code.

Thank you for telling me about the "LocationLayer" plugin. I will be updating my code to use the new plugin.

Since the problem is in my code on my end, I'll be closing this issue. Thank you for the assistance @tobrun :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

2 participants