Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
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

Closed

Description

@13kz

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).

Activity

  1. added
    Android
    on May 30, 2017
  2. tobrun commented on May 30, 2017

    @tobrun
    Member

    @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.

  3. 13kz commented on May 30, 2017

    @13kz
    Author

    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

  4. LukasPaczos commented on May 30, 2017

    @LukasPaczos
    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.

  5. 13kz commented on May 30, 2017

    @13kz
    Author

    @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.

  6. LukasPaczos commented on Jun 7, 2017

    @LukasPaczos
    Contributor

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

  7. reopened this on Jun 7, 2017
  8. Guardiola31337 commented on Jun 19, 2017

    @Guardiola31337
    Contributor

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

    Thanks @LukasPaczos

  9. 13kz commented on Jun 19, 2017

    @13kz
    Author

    Yep @Guardiola31337 we are good.
    Nice @LukasPaczos

  10. Guardiola31337 commented on Jun 19, 2017

    @Guardiola31337
    Contributor

    @13kz Thanks a lot 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Androidsupport

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions