I have integrated Google map in my application. I am able to find my current location. I want map to auto rotate when i change the direction. How can i achieve this.
Thanks
See Question&Answers more detail:osI have integrated Google map in my application. I am able to find my current location. I want map to auto rotate when i change the direction. How can i achieve this.
Thanks
See Question&Answers more detail:osCaveat: Not an expert
Based on Google API docs, sounds like you need to adjust the bearing, such as described in GroundOverlay#setBearing.
public final class GroundOverlay
A ground overlay is an image that is fixed to a map. A ground overlay has the following properties:
...
Bearing
The amount that the image should be rotated in a clockwise direction. The center of the rotation will be the image's anchor. This is optional and the default bearing is 0, i.e., the image is aligned so that up is north.
Example:
GoogleMap map = ...; // get a map.
BitmapDescriptor image = ...; // get an image.
LatLngBounds bounds = ...; // get a bounds
// Adds a ground overlay with 50% transparency.
GroundOverlay groundOverlay = map.addGroundOverlay(new GroundOverlayOptions()
.image(image)
.positionFromBounds(bounds)
.transparency(0.5));