I am using the Google Maps SDK for my iOS App.
You can zoom in on the map using either of two gestures.
In the first way, the map zooms in, but the map shifts near to the position where I double tap. While in the second method, the map zooms in staying at the current map centre.
I want to achieve the second type of behaviour(map staying on current centre rather than shifting) on the first gesture too. How do I go about it?
EDIT: Basically the behaviour should be same as the Official Google Map Double Tap.
This is a config item in GMSUISettings class, so you can access it on your GMSMapView
object's 'settings' property like below,
Obj-C:
mapView.settings.allowScrollGesturesDuringRotateOrZoom = NO;
Swift 2.1:
mapView.settings.allowScrollGesturesDuringRotateOrZoom = false
I had to dig into their source code to find this config item, its not mentioned anywhere in the docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With