Bob Lee Bob Lee - 1 year ago 125
Swift Question

Google Map SDK Swift, Zooming in and out like Uber's Map

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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download