waar19 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Rotate the direction arrow according to the bearing AND screen orientation #95

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. check green arrow orientation.
2. rotate the screen.
3. the map rotates but the arrow does not.

What is the expected output? What do you see instead?
the arrow should rotate accordingly to the screen orientation

Original issue reported on code.google.com by claur...@gmail.com on 25 Sep 2010 at 5:03

GoogleCodeExporter commented 9 years ago
I suppose you're talking about the MyLocationOverlay class, right?

Original comment by mpr....@gmail.com on 29 Sep 2010 at 10:42

GoogleCodeExporter commented 9 years ago
Issue 140 has been merged into this issue.

Original comment by kurtzm...@gmail.com on 24 Jan 2011 at 3:37

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r756.

Original comment by kurtzm...@gmail.com on 24 Jan 2011 at 3:48

GoogleCodeExporter commented 9 years ago
I took a look into this and it does make sense - when the orientation of the 
phone changes, Android changes the screen coordinate system by rotating it, 
however the physical orientation sensor also rotates with the device but does 
not change its orientation along with the screen (since it doesn't know that 
the screen orientation changed). So we have to offset by +90 manually. This 
assumes that Android only allows two screen rotations - 0 degrees (portrait) 
and 90 degrees (landscape) and does not permit 180 or 270 degrees (upside-down 
portrait and upside-down landscape respectively). This is probably a bad 
assumption, so maybe there is a better way to do this. 
SensorManager.remapCoordinateSystem might be able to help.

But for now, it works. The above issues are notated in the code.

Original comment by kurtzm...@gmail.com on 24 Jan 2011 at 3:48