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.
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
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.
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