3

I am trying to implement the Google Map SDK, and so far I have implemented a marker. I made the marker in a way that it follows as it is located in the center when I move the camera position.

The problem is that I can't zoom in and out while the marker's location is not changing. I would like to make the zooming experience like Uber in which the location does not change.. Thank you for your help.

Bob Lee
  • 755
  • 4
  • 12

1 Answers1

1

You can use this line allowScrollGesturesDuringRotateOrZoom to your GMSMapview. It controls whether rotate and zoom gestures can be performed off-center and scrolled around. The default value of this is YES.

mapView.settings.allowScrollGesturesDuringRotateOrZoom = false // NO for obj-c and false for swift

So by setting it by NO/false, you can now perform zooming while the marker location is not moving. For more information, check this thread.

KENdi
  • 7,576
  • 2
  • 16
  • 31
  • Thank you so much.. you literally saved my life because I have been dealing with this problem for 3 hours. – Bob Lee Sep 12 '16 at 03:47
  • Hello there. I wonder if you can help me with my problem: http://stackoverflow.com/questions/39450670/moving-camera-in-google-maps – Jayson Tamayo Sep 12 '16 at 16:13