Is there a Google Map event listener for panning or zooming map?

google maps events
google maps marker, 'click event listener
google maps bounds_changed
google map drag event
google maps infowindow click event
google maps adddomlistener
google maps polygon events
zoom_changed event google map

I want to be able to detect if the user has zoomed out or moved the map center. I have seen post about an event listener but in Javascript and I am trying to see if there is anything in the Google Maps iOS SDK similar to that. I see that iPad Yelp app has something like that, where if you zoom in/out or move the map a Tool Bar appears from the bottom and lets the user know if they want to "Redo Search In Area". I want to do something similar like that and reload the map with other/more markers.

I have looked at Google Map's Reference guide but have not found anything, unfortunately. If anyone has had something similar to this or has any guidance on how this can be accomplished, any information would be great. Thanks in advance!

Link to Google Map Documentation I have looked at:

https://developers.google.com/maps/documentation/ios/reference/protocol_g_m_s_map_view_delegate-p

https://developers.google.com/maps/documentation/ios/reference/interface_g_m_s_coordinate_bounds

I use this delegate to detect the camera change, which includes zoom and position:

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

EDIT

with this code you can get the corners of the visibile area:

NSLog(@"%f,%f",_mapView.projection.visibleRegion.farLeft.latitude,_mapView.projection.visibleRegion.farLeft.longitude);//north west
NSLog(@"%f,%f",_mapView.projection.visibleRegion.farRight.latitude,_mapView.projection.visibleRegion.farRight.longitude);//north east
NSLog(@"%f,%f",_mapView.projection.visibleRegion.nearLeft.latitude,_mapView.projection.visibleRegion.nearLeft.longitude);//south west
NSLog(@"%f,%f",_mapView.projection.visibleRegion.nearRight.latitude,_mapView.projection.visibleRegion.nearRight.longitude);//south east

Google Maps always zooming out, , press the navigation button in the lower right corner and optionally switch off voice navigation. In this example you will learn how to add Idle Event Listener to google map. This event fires when the map becomes idle after panning or zooming. Here you can view the output of the example and you can also "try it yourself" by clicking on "Live Demo" button given at the bottom. Syntax

Try delegate method - (void)mapView:(GMSMapView *)mapView willMove:(BOOL)gesture, the BOOL parameter tells you that the mapView is moved by user or not.

Controlling Zoom and Pan | Maps JavaScript API, How do I control the zoom on a Google Map? To see a map with less detail you need to zoom out. To do this, click the - sign on the bottom of the zoom bar. As the scale changes the map will also change to show a different Google map, one which is more appropriate for the scale. The key to the Google Maps pan and zoom tools is shown below: Centreing the map

To detect end of moving/zooming Google Map view :

I came across this question while seeking for how to detect if google map ended up with moving/zooming to get map's centre. I tried capture this event in didChangeCameraPosition as suggested by Allemattio, but that is getting called multiple time as we pan or zoom map. Luckily I found another delegate method of map view that is called when we ended up with panning or zooming map view :

-(void)mapView:(GMSMapView *)mapView idleAtCameraPosition:(GMSCameraPosition *)position
{
      NSLog(@"mapView ended with panning/zooming in %s",__PRETTY_FUNCTION__);
}

google map API zoom range, north up." Activate its toggle and never do that awkward head- UI events within the Maps JavaScript API typically pass an event argument, which can be accessed by the event listener, noting the UI state when the event occurred. For example, a UI 'click' event typically passes a MouseEvent containing a latLng property denoting the clicked location on the map. Note that this behavior is unique to UI

Swift

extension MyMapViewController:GMSMapViewDelegate {

    func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) {
        //do something
    }
}

9 handy hidden features for Google Maps on Android, I use this delegate to detect the camera change, which includes zoom and position: - (void)mapView:(GMSMapView *)mapView  The maps in the Maps SDK for Android can be tilted and rotated with easy gestures, giving users the ability to adjust the map with an orientation that makes sense for them. At any zoom level, you can pan the map, or change its perspective with very little latency thanks to the smaller footprint of the vector-based map tiles.

Is there a Google Map event listener for panning or zooming map , I use this delegate to detect the camera change, which includes zoom and position: - (void)mapView:(GMSMapView *)mapView  Programmatically pan the map so that it is continually in motion

ios, google.maps.event.addListener(marker,'click',function() { map.setZoom(9); map. Here, we save the zoom changes and pan the map back after 3 seconds:  I'm trying to create an event listener that turns off a google fusion layer once the map is zoomed in to a certain level. I'm pretty new to javascript and its google maps api, so any help is apprec

Google Maps Events, Here is some code I'm successfully using to toggle a Fusion Tables layer in one of my maps: google.maps.event.addListener(map, 'zoom_changed', function()  Using the Maps SDK for Android, you can listen to events on the map. The ApiDemos repository on GitHub includes samples that demonstrates events and listeners: If you want to respond to a user tapping on a point on the map, you can use an OnMapClickListener which you can set on the map by calling GoogleMap.setOnMapClickListener

Comments
  • Amazing! How would I use this to detect if the camera or map is out of frame/bounds/region? Would I just create my own position object and see if the two are the same? Also, how do I get the top right corner and bottom left corner coordinates?
  • Thanks! How can I detect if the user has moved away from a certain region. I have these markers and have set up the map to show all the markers and want to reload new markers if they leave this region. I know google maps has GMSVisibleRegion but wouldn't know how to use it with any of these delegate calls. Any ideas?
  • @Chris, it seems that you have 2 things to do: 1st is show a toolbar and 2nd is reload markers base on current visible region? if so, I'll show the toolbar in - (void)mapView:(GMSMapView *)mapView willMove:(BOOL)gesture and reload markers in - (void)mapView:(GMSMapView *)mapView didChangeCameraPosition:(GMSCameraPosition *)position. Additional, the didChangeCameraPosition delegate will be called several times in a move process, you may do reload markers in a delay period.
  • This was the perfect to reduce the method calls since didChangeCameraPosition called soo many times! thanx