I make a Google map where compass automatically directs north. But I have to make this compass's indicator always to the West. How can i do it?Any ideas?Do i need to perform any special terms? Please Help me :(
Asked
Active
Viewed 616 times
0
-
`@Override public void onResume() { super.onResume(); MyLocationOverlay me.enableCompass();}` I am just enable the compass and it automatically generated. – Android Girl May 07 '12 at 06:57
1 Answers
0
[bearing from north + 90°] modulo(360)
Derive your own class from MyLocationOverlay. Override drawCompass(); Manipulate the Canvas object you're handed as necessary. Call super.drawCompass() to draw the compass at your new location. Restore the Canvas to how you found it.
protected void drawCompass(android.graphics.Canvas canvas,float bearing) is the key for what you want!! with few changes in the bearing value after getting north bearing

K_Anas
- 31,226
- 9
- 68
- 81
-
-
Derive your own class from MyLocationOverlay. Override drawCompass(); Manipulate the Canvas object you're handed as necessary. Call super.drawCompass() to draw the compass at your new location. Restore the Canvas to how you found it. – K_Anas May 07 '12 at 07:24
-