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

User Position doesn't take real bearing value when tracking mode is NONE #9132

Closed
13kz opened this issue May 29, 2017 · 8 comments
Closed

User Position doesn't take real bearing value when tracking mode is NONE #9132

13kz opened this issue May 29, 2017 · 8 comments
Labels
Android Mapbox Maps SDK for Android support

Comments

@13kz
Copy link

13kz commented May 29, 2017

Platform:Android
Mapbox SDK version:Release Android v5.1.0-beta.3

I'm working on a sample of navigation mode (like your CarDrivingActivity in last version).
The code below activate the tracking and set GPS bearing mode.
trackingSettings.setMyLocationTrackingMode(MyLocationTracking.TRACKING_FOLLOW);
trackingSettings.setMyBearingTrackingMode(MyBearingTracking.GPS);

I replace the default drawable icon in MyLocationViewSettings by a custom drawable. This let me know the orientation of user position.

Expected behavior

Without disabling all gesture, when the user pan the map, the tracking mode is NONE and the user position bearing should take real myLocation bearing value.

Actual behavior

The pan on the map disable the tracking and myLocationView ignore bearing value (I think it equals to 0).

@tobrun tobrun added Android Mapbox Maps SDK for Android support labels May 30, 2017
@tobrun
Copy link
Member

tobrun commented May 30, 2017

@13kz you can fine tune this behaviour with a couple of flags in trackingsettings. eg. you don't want to dismiss tracking at all when a gesture occuirs:

TrackingSettings#setDismissAllTrackingOnGesture(false)

You can also do this more granular:

TrackingSettings#setDismissLocationTrackingOnGesture

or

TrackingSettings#setDismissBearingTrackingOnGesture

If this doesn't fit your use-case completely you can hook into these dismissal events with:

TrackingSettings#setOnMyLocationTrackingModeChangeListener

or

TrackingSettings#setOnMyBearingTrackingModeChangeListener

Let us know if you have any more questions or if you aren't able to use above to handle your use-case.
Closing for now as answered.

@tobrun tobrun closed this as completed May 30, 2017
@13kz
Copy link
Author

13kz commented May 30, 2017

Thanks @tobrun for your answer. I try to avoid dismissing bearing tracking on gesture when i'm in navigation mode and it's solve my problem.

TrackingSettings#setDismissBearingTrackingOnGesture(false)
Update : setDismissBearingTrackingOnGesture instead of AllTrackingGesture

@LukasPaczos
Copy link
Contributor

@tobrun @13kz I stumbled on this same issue. However, even if TrackingSettings#setDismissBearingTrackingOnGesture is set to false when we are in MyLocationTracking#TRACKING_NONE mode (therefore MyLocationShowBehavior is used) bearing is not updated on location change as MyLocationView#setBearing() is never called. I tried invoking MyLocationView#setBearing() from MyLocationView#setLocation() but I doesn't seem to do the trick.

@13kz
Copy link
Author

13kz commented May 30, 2017

@LukasPaczos Without setting TrackingSettings#setDismissBearingTrackingOnGesture(false), it's seems like the bearing equals to 0. And when you rotate the map the arrow is pointing the top of my device.

@LukasPaczos
Copy link
Contributor

@13kz check out #9207. That is what worked for me to update bearing while TRACKING_NONE mode is on.

@Guardiola31337
Copy link
Contributor

Hey 👋 @13kz
#9212 landed with the fix, are we good to close here?

Thanks @LukasPaczos

@13kz
Copy link
Author

13kz commented Jun 19, 2017

Yep @Guardiola31337 we are good.
Nice @LukasPaczos

@13kz 13kz closed this as completed Jun 19, 2017
@Guardiola31337
Copy link
Contributor

@13kz Thanks a lot 😉

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

No branches or pull requests

4 participants