You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was 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
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).
@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:
@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.
@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.
Activity
tobrun commentedon 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:
You can also do this more granular:
or
If this doesn't fit your use-case completely you can hook into these dismissal events with:
or
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.
13kz commentedon 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.
LukasPaczos commentedon May 30, 2017
@tobrun @13kz I stumbled on this same issue. However, even if
TrackingSettings#setDismissBearingTrackingOnGestureis set tofalsewhen we are inMyLocationTracking#TRACKING_NONEmode (thereforeMyLocationShowBehavioris used) bearing is not updated on location change asMyLocationView#setBearing()is never called. I tried invokingMyLocationView#setBearing()fromMyLocationView#setLocation()but I doesn't seem to do the trick.13kz commentedon 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 commentedon Jun 7, 2017
@13kz check out #9207. That is what worked for me to update bearing while
TRACKING_NONEmode is on.Guardiola31337 commentedon Jun 19, 2017
Hey 👋 @13kz
#9212 landed with the fix, are we good to close here?
Thanks @LukasPaczos
13kz commentedon Jun 19, 2017
Yep @Guardiola31337 we are good.
Nice @LukasPaczos
Guardiola31337 commentedon Jun 19, 2017
@13kz Thanks a lot 😉