It works fine, but the chevron shows up in the middle of the Atlantic Ocean. I guess it becomes active, and adjusts its position to the user’s current position when the user is driving or moving?
Is there a way to set an initial position of the chevron? Or is there anything that I am missing?
Because the chevron didn’t move, I checked the coordinates of the chevron with below code. It seems the coordinates are updated fine, showing the correct numbers.
chevron.getPosition().getCoordinates()
However, the map is still showing the chevron in the middle of the ocean. Have you ever had this kind of issue?
Chevron by default is set as inactive. To make it move as user is moving I would register an LocationUpdateListener in TomTomMap and whenever new location update is available you pass it to the chevron aswell.
Something like this:
@Override
public void onLocationChanged(Location location) {
ChevronPosition chevronPosition = new ChevronPosition.Builder(location).build();
chevron.setDimmed(false); //this makes your chevron active
chevron.setPosition(chevronPosition);
chevron.show(); //used only if your logic hides chevron in some circumstances
}
And to make your chevron inactive which indicates e.g., that location is too inaccurate simply call
Hello @Flyentology12 , @kyungsuksong,
I was also using chevron and tracking feature to track user location. But when I take turn left or right or takes U turn on road, position of chevron changes but camera position i.e. bearing don’t change.
So any idea about this ?
Hi, yes in iOS I have mapView.trackingManager.start(chevron) and on android I have
tomtomMap.drivingSettings.startTracking(chevron) and the position of the chevron changes but the heading / bearing does not.
I can’t reproduce the issue. Can you try to reproduce it in our sample application(sampleapp-ktx) and post a code snippet here or create an issue on GitHub directly?
Code for Chevron tracking can be found in these classes:
Hello @Flyentology12 I managed to solve the issue. The problem was that I was not passing the bearing / heading to the matcher (it was always zero) and so the chevron faced the same direction all the time. My bad the issue is solved thanks for the help