如何将 GMSMapMarker 视图置于坐标中心

How can I center the GMSMapMarker view in a coordinate

有没有办法使橙色箭头(GMSMapMarker)在坐标中居中、更改视图框架或其他方式?我正在为 iOS 使用 Google 地图。我可以将视图旋转一个角度,但我想在自定义坐标中设置视图的中心。

我认为您可以使用 GMSCoordinateBounds 计算 pixel/degree,然后您可以根据图标大小和标题移动中心。

我找到了使用 GMSMarker 的 属性 groundAnchor 的解决方案:

_mapMarker.groundAnchor = CGPointMake(0.5,0.5);