Reputation: 1071
In my application, i used googlemap. In that, in a particular location i placed one object(Bike or Car). Then i moved to some other location. Now, based on my current location i need to show one arrow(campus) , in which direction i placed my Car or Bike.
For this, i saved my object location values in SharedPreferences , and i get Current location values(Lat and Lang). But, i dont know how to show arrow in that particular direction.
Finally, i have both (my object and my current location) latitude and longitude values. But, i am unable to show arrow from my current location to my object.
So, please guide how to do this.
Upvotes: 1
Views: 1350
Reputation: 653
Look in to this
http://googlemaps.github.io/android-maps-utils/
its a utility library that people put together.
Look into https://github.com/googlemaps/android-maps-utils/tree/master/library/src/com/google/maps/android
There is a SphericalUtil.java which has a method called computeHeading that might help. Beside all, there are lots of helpful methods in this library for use.
Hope it helps
Upvotes: 1