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

后端 未结 4 1306
刺人心
刺人心 2021-02-19 20:10

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 any

4条回答
  •  忘掉有多难
    2021-02-19 20:53

    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__);
    }
    

提交回复
热议问题