GraphHopper.com | Forum | GitHub | Maps | Blog

How to move car icon in the direction of movement?


#1

I am using “mapsforge” library to show offline navigation on a map.Now I have to show car icon on a map with moving my car.Actually, the problem is how can I point icon head in the direction of destination (where we are moving ).


#2

Please ask this in the mapsforge forum.


#3

You can get the direction in degree using the following sensors, and then rotate the car according to the degree:

Sensor.TYPE_ACCELEROMETER and Sensor.TYPE_MAGNETIC_FIELD

look at this class int degree is what you should pay attention in this class and is exactly what you are looking for.
sorry for bad (not clear) code, this code is for about 4 years ago.