Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the delegate method for Ios Google maps for did finish scrolling?

In Apple maps there is a delegate method

-(void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated

and is fired when I end scrolling or panning the map but I could not find such method for google maps. There is a method

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

but this method keeps on firing while the map is still being scrolled and I don't want that. I have to change a property only when scrolling is finished.

like image 390
Bharat Gulati Avatar asked Apr 11 '13 08:04

Bharat Gulati


2 Answers

The latest SDK release Version 1.4.0 - July 2013 has added a new delegate method

- (void)mapView:(GMSMapView *)mapView idleAtCameraPosition:(GMSCameraPosition *)position 

that will be triggered at the end of any camera movement or scrolling action

like image 172
tony m Avatar answered Sep 18 '22 14:09

tony m


There is a feature request to add something like this:

https://code.google.com/p/gmaps-api-issues/issues/detail?id=4722

In the meantime you could perhaps work around it by using a regular timer which checks if the map position has changed since the last call to the timer. If not then the user has stopped moving the map and so you can update your property.

like image 38
Saxon Druce Avatar answered Sep 20 '22 14:09

Saxon Druce