TTMapViewCameraDelegate
Objective-C
@protocol TTMapViewCameraDelegate <NSObject>
Swift
protocol TTMapViewCameraDelegate : NSObjectProtocol
TTMapViewCameraDelegate
-
A callback interface called when the map viewport moves. It is executed each time the user interacts with the map (e.g., the map is panned or zoomed).
Declaration
Objective-C
- (void)mapView:(TTMapView *_Nonnull)mapView onCameraChanged:(TTCameraPosition *_Nonnull)cameraPosition withState:(TTMapCameraChangeState)state;
Swift
optional func mapView(_ mapView: TTMapView, onCameraChanged cameraPosition: TTCameraPosition, with state: TTMapCameraChangeState)
Parameters
mapView
mapView The map view instance.
cameraPosition
cameraPosition The TTCameraPostion object that is present and current.
-
A callback interface called when the map viewport moves. It is executed each time the user interacts with the map (e.g., the map is panned or zoomed).
Declaration
Objective-C
- (void)mapView:(TTMapView *_Nonnull)mapView onCameraChanged:(TTCameraPosition *_Nonnull)cameraPosition;
Swift
optional func mapView(_ mapView: TTMapView, onCameraChanged cameraPosition: TTCameraPosition)
Parameters
mapView
mapView The map view instance.
cameraPosition
cameraPosition The TTCameraPostion object that is present and current.
-
A callback interface called when the map finishes centering. Every user interaction on the map cancels centering on the map.
Declaration
Objective-C
- (void)mapView:(TTMapView *_Nonnull)mapView onCenterStatusChanged:(TTMapCenteredState)centeredState;
Swift
optional func mapView(_ mapView: TTMapView, onCenterStatusChanged centeredState: TTMapCenteredState)
Parameters
mapView
mapView The map view instance.
centeredState
centeredState The TTMapCenteredState object’s present status when map centering.
-
This method is deprecated. Use callbacks onCameraChanged instead.
Declaration
Objective-C
- (void)mapView:(TTMapView *_Nonnull)mapView didChangCameraPosition:(TTCameraPosition *_Nonnull)cameraPosition;
Swift
optional func mapView(_ mapView: TTMapView, didChangCameraPosition cameraPosition: TTCameraPosition)
Parameters
mapView
mapView The map view instance.
cameraPosition
cameraPosition The TTCameraPostion object present during the current state of the camera.
-
This method is deprecated. Use callbacks onCameraChanged instead.
Declaration
Objective-C
- (void)mapView:(TTMapView *_Nonnull)mapView isChangingCameraPosition:(TTCameraPosition *_Nonnull)cameraPosition;
Swift
optional func mapView(_ mapView: TTMapView, isChanging cameraPosition: TTCameraPosition)
Parameters
mapView
mapView The map view instance.
cameraPosition
cameraPosition TTCameraPostion object present current state of camera.
-
This method is deprecated. Use callbacks onCameraChanged instead.
Declaration
Objective-C
- (void)mapView:(TTMapView *_Nonnull)mapView willChangeCameraPosition:(TTCameraPosition *_Nonnull)cameraPosition;
Swift
optional func mapView(_ mapView: TTMapView, willChange cameraPosition: TTCameraPosition)
Parameters
mapView
mapView The map view instance.
cameraPosition
cameraPosition TTCameraPostion object present current state of camera.