0

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 :(

Android Girl
  • 2,074
  • 3
  • 22
  • 29
  • `@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 Answers1

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
  • how can i set it in my map activity? – Android Girl May 07 '12 at 07:03
  • 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
  • Have you any useful link which help me more perfectly? – Android Girl May 07 '12 at 07:48