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

Current location heading resets when speed=0 #63

Open
imranMnts opened this issue Jun 14, 2023 · 7 comments
Open

Current location heading resets when speed=0 #63

imranMnts opened this issue Jun 14, 2023 · 7 comments

Comments

@imranMnts
Copy link

Hello,

that's an existing issue on Mapbox side but was fixed normally in 2017 so before the fork of Maplibre if I'm not wrong.

Mapbox ticket:
mapbox/mapbox-navigation-android#95

We're facing the same issue, when we stop to move, the camera is doing weird moves.

App configuration setup

  implementation 'com.github.maplibre:maplibre-navigation-android:2.0.0'
  implementation 'org.maplibre.gl:android-sdk:10.0.2'
  implementation 'org.maplibre.gl:android-plugin-annotation-v9:1.0.0'

Expected behaviour
The camera should not move when the user stops to move

Actual behaviour
The camera is doing weird moves

@boldtrn
Copy link
Collaborator

boldtrn commented Jun 14, 2023

Have you enabled snap on route? Have you changed the route snapping in your code?

Is this issue happening with the navigation sample in this repo?

@Fabi755
Copy link
Collaborator

Fabi755 commented Jun 14, 2023

We also have the same behavior. Even with route snapping enabled.

Thanks for linking the Mapbox issue, this will really helps!

While we also need this fix, I will have a look on this problem after my other issue is finished. Assuming no one is faster 😜

@boldtrn
Copy link
Collaborator

boldtrn commented Jun 14, 2023

I think the linked code should be indeed included in this code base here as well. Maybe there is an edge case in the code? Maybe there is a different issue at play here, as the heading is forced onto the route. We have seen issues like this when using the simulation.

@imranMnts
Copy link
Author

@boldtrn It looks like we already have the code present in the PR that I mentioned. Maybe an edge case yes.

I tried with the locationEngine but I didn't test with snapEngine, I'll test and give you my feedback on that.

@imranMnts
Copy link
Author

@boldtrn Same behaviour with snapEngine = SnapToRoute()

Don't know if we should set another thing to allow snapEngine to work as expected

@Fabi755
Copy link
Collaborator

Fabi755 commented Jul 3, 2023

Don't know if we should set another thing to allow snapEngine to work as expected

Yes! I made the same mistake. You need to change the following things:

  1. snapToRoute(true)
  2. useDefaultLocationEngine(false)
  3. and call forceLocationUpdate(Location) in ProgressChangeListener

@imranMnts
Copy link
Author

imranMnts commented Jul 3, 2023

Thank you @Fabi755 I tried your suggestion but I have the same behaviour

Looks a bit reduced but the icon is still turning when the speed is reduced to 0km/h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants