2

enter image description here

Is there a way to center the orange arrow (a GMSMapMarker) in a coordinate, changing the view frame or something? I'm using Google Maps for iOS. I can rotate the view with an angle, but I want to set the view's center in a custom coordinate.

Jimmy
  • 873
  • 3
  • 12
  • 29

2 Answers2

2

I found the solution using the property groundAnchor of GMSMarker:

_mapMarker.groundAnchor = CGPointMake(0.5,0.5);

Jimmy
  • 873
  • 3
  • 12
  • 29
0

I think you can calculate the pixel/degree by using the GMSCoordinateBounds, then you can shift the center bases on your icon size and heading.

kaho
  • 4,746
  • 1
  • 16
  • 24