I want google maps marker to stay in the centre of the map while camera position can change iOS SDK

I am developing an iOS app which uses google maps. I want the marker to stick to the centre of the screen while dragging map or changing camera position. I have implemented below code. It keeps the marker at the centre of the screen, but marker moves when we drag the map and the repositions to centre. I want it to stay at the centre of the screen without moving it.

- (void)mapView:(GMSMapView *)pMapView didChangeCameraPosition:(GMSCameraPosition *)position {

    /* move draggable pin */
    if (movingMarker) {
        CLLocationCoordinate2D location = pMapView.camera.target;
        [movingMarker setPosition:location];

Thanks in advance!


Solution is simple! Just place image view on top of map view, make image view same size (put same constraints, or autoresizing), and set your pin image to image view, set .center contentMode to image view. That's it! You don't have to add a marker to the map view itself. If you want to get pin (map view center) coordinate, use mapView.projection.coordinate(for: CGPoint) of google maps, where you have to pass map view's center point. Good luck!


 ? Google maps - keep center when zooming
 ? Type 'Promise<void>' is not assignable to type 'Marker'. Property '_objectInstance' is missing in type 'Promise<void>'. Ionic 2
 ? Google Map is not showing on live site using Avada theme
 ? Adding google tiles with R
 ? Chrome navigator.geolocation.getCurrentPosition() error 403
 ? How to move inside google maps only with two fingers?
 ? React Native: Alert message doesn't work when called frequently
 ? React native ToolbarAndroid action icon not working
 ? Android 6.0 Permission Error
 ? Android 6.0 Permission Error