var angle = 130.0; var x = Math.sin(-angle * Math.PI / 180) * 0.5 + 0.5; var y = -(Math.cos(-angle * Math.PI / 180) * 0.5 - 0.5); marker.setInfoWindowAnchor((float)x, (float)y);
Explanation:
If we assume that the map marker is round (the most reasonable for the purpose of rotation), and, as we know, the InfoWindow (B) anchor point can be set to any relative coordinate point from 0,0,0,0 (at the top left) to 1.1 (bottom right) we can find any point on the circle line with a given degree of rotation using the SIN and COS formulas.

X distance between A and B = radius * SIN (degree); Y distance between A and B = radius * COS (degree);
Accepting them for the coordinates of the Android marker, we get:
var x = Math.sin(-angle * Math.PI / 180) * 0.5 + 0.5;
- We find SINE from the opposite rotation angle (negative value) to radians (degree * PI / 180);
- Multiply the radius of the circle (0.5) to get the distance along the X axis;
- Move right along the radius (+0.5) in the middle of the form (along the X axis);
var y = -(Math.cos(-angle * Math.PI / 180) * 0.5 - 0.5);
- Find COSINE from the rotation angle of the oposit (negative value) converted to radians (degree * PI / 180);
- Multiply the radius of the circle (0.5) to get the distance along the Y axis;
- Move up the radius (-0.5) at the top of the shape (along the Y axis);
- Make the value positive (with a - sign) as the marker coordinate system has positive values ββon the Y axis down;
Arvis source share