@@ -1844,7 +1844,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
1844
1844
return Promise . reject ( "'setOnFlingListener' is not supported on iOS" ) ;
1845
1845
}
1846
1846
1847
- async setOnCameraMoveListener ( listener : ( ) => void , nativeMap ?: any ) : Promise < void > {
1847
+ async setOnCameraMoveListener ( listener : ( reason , animated ? ) => void , nativeMap ?: any ) : Promise < void > {
1848
1848
const theMap : MGLMapView = nativeMap || this . _mapboxViewInstance ;
1849
1849
if ( theMap ) {
1850
1850
( theMap . delegate as MGLMapViewDelegateImpl ) . setCameraChangedListener ( listener ) ;
@@ -2659,7 +2659,7 @@ class MGLMapViewDelegateImpl extends NSObject implements MGLMapViewDelegate {
2659
2659
2660
2660
private userLocationClickListener : ( annotation : MGLAnnotation ) => void ;
2661
2661
private userLocationChangedListener : ( location : UserLocation ) => void ;
2662
- private cameraChangedListener : ( ) => void ;
2662
+ private cameraChangedListener : ( reason , animated ?: boolean ) => void ;
2663
2663
private cameraIdledListener : ( ) => void ;
2664
2664
private userLocationRenderMode : any ;
2665
2665
private userLocationAnnotationView : CustomUserLocationAnnotationView ;
@@ -2933,18 +2933,21 @@ class MGLMapViewDelegateImpl extends NSObject implements MGLMapViewDelegate {
2933
2933
return null ;
2934
2934
}
2935
2935
2936
- mapViewRegionIsChanging ( ) {
2936
+ mapViewRegionIsChangingWithReason ( mapView : MGLMapView , reason : MGLCameraChangeReason ) {
2937
2937
if ( Trace . isEnabled ( ) ) {
2938
2938
CLog ( CLogTypes . info , 'MGLMapViewDelegateImpl::mapViewRegionIsChanging()' ) ;
2939
2939
}
2940
2940
if ( this . cameraChangedListener ) {
2941
- this . cameraChangedListener ( ) ;
2941
+ this . cameraChangedListener ( reason ) ;
2942
2942
}
2943
2943
}
2944
- mapViewRegionDidChangeAnimated ( animated ) {
2944
+ mapViewRegionDidChangeWithReasonAnimated ? ( mapView : MGLMapView , reason : MGLCameraChangeReason , animated : boolean ) {
2945
2945
if ( Trace . isEnabled ( ) ) {
2946
2946
CLog ( CLogTypes . info , 'MGLMapViewDelegateImpl::mapViewRegionDidChangeAnimated()' ) ;
2947
2947
}
2948
+ if ( this . cameraChangedListener ) {
2949
+ this . cameraChangedListener ( reason , animated ) ;
2950
+ }
2948
2951
if ( this . cameraIdledListener ) {
2949
2952
this . cameraIdledListener ( ) ;
2950
2953
}
0 commit comments