Search code examples
iosgoogle-mapsgoogle-maps-markersgoogle-maps-sdk-ios

Google Maps SDK for IOS - Marker always centered


Im trying to develop an app that lets the user change its position on a map. I actually have a marker that repaints its position to the map camera on a mapView:didChangeCameraPosition event and it works ok, but the problem i see is that performance is not good enough since the marker is repainted in the map with some delay.

I would like to know if there is a better approach to implement this requirement

here is my actual code:

- (void)mapView:(GMSMapView *)mapView didChangeCameraPosition:(GMSCameraPosition *)position {
      self.marker.position = position.target;  
  }

Solution

  • Could you just add a UIImageView with the marker, over the top of the GMSMapView, positioned in the middle of it?