Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
173 views
Welcome To Ask or Share your Answers For Others

1 Answer

Caveat: 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));

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...