iOS GoogleMaps SDK - animateToCameraPosition animation finished handler?

后端 未结 5 1897
离开以前
离开以前 2021-02-19 14:54

Currently I am using the GoogleMaps SDK for iOS for various operations. When calling

[self.googleMapsView animateToCameraPosition:[GMSCameraPosition 
                  


        
5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-19 15:30

    I don't believe there is, however...

    A method that has worked well for me so far is to set a timer to fire (very) shortly after the location stops updating:

    - (void)mapView:(GMSMapView*)mapView didChangeCameraPosition:(GMSCameraPosition*)position {
      // _panTimer is an instance variable of the delegate.
      [_panTimer invalidate];
      _panTimer = [NSTimer timerWithTimeInterval:0.2
                                          target:self
                                        selector:@selector(_mapHasStoppedMoving)
                                        userInfo:nil
                                         repeats:NO];
      [[NSRunLoop currentRunLoop] addTimer:_panTimer forMode:NSDefaultRunLoopMode];
    }
    

提交回复
热议问题