TTMapViewDelegate

@protocol TTMapViewDelegate <NSObject>

The TTMapViewDelegate protocol defines a set of optional methods that you can use to receive map-related update messages. Because many map operations require the TTMapView class to load data asynchronously, the map view calls these methods to notify your application when specific operations complete.

  • Tells the delgate that the specified map view is ready to be used.

    Declaration

    Objective-C

    - (void)onMapReady:(TTMapView *_Nonnull)mapView;

    Swift

    optional func onMapReady(_ mapView: TTMapView)

    Parameters

    mapView

    The map view.

  • Tells the delgate when the map view port moves. It is executed each time the user interact with the map (e.g. map is panned or zoomed).

    Declaration

    Objective-C

    - (void)mapView:(TTMapView *_Nonnull)mapView
        didChangedCameraPosition:(TTCameraPosition *_Nonnull)cameraPosition;

    Swift

    optional func mapView(_ mapView: TTMapView, didChangedCameraPosition cameraPosition: TTCameraPosition)

    Parameters

    mapView

    mapView The map view instance.

    cameraPosition

    cameraPosition TTCameraPostion object present current state of camera.

  • Tells the delegate that the specified map view with pan gesture recognizer.

    Declaration

    Objective-C

    - (void)mapView:(TTMapView *_Nonnull)mapView
         didPanning:(CLLocationCoordinate2D)coordinate;

    Swift

    optional func mapView(_ mapView: TTMapView, didPanning coordinate: CLLocationCoordinate2D)

    Parameters

    mapView

    The map view.

    coordinate

    for panning.

  • Tells the delegate that the specified map view with double tap gesture recognizer.

    Declaration

    Objective-C

    - (void)mapView:(TTMapView *_Nonnull)mapView
        didDoubleTap:(CLLocationCoordinate2D)coordinate;

    Swift

    optional func mapView(_ mapView: TTMapView, didDoubleTap coordinate: CLLocationCoordinate2D)

    Parameters

    mapView

    The map view.

    coordinate

    for a double tap.

  • Tells the delegate that the specified map view with single tap gesture recognizer.

    Declaration

    Objective-C

    - (void)mapView:(TTMapView *_Nonnull)mapView
        didSingleTap:(CLLocationCoordinate2D)coordinate;

    Swift

    optional func mapView(_ mapView: TTMapView, didSingleTap coordinate: CLLocationCoordinate2D)

    Parameters

    mapView

    The map view.

    coordinate

    for a single tap.

  • Tells the delegate that the specified map view with long press gesture recognizer.

    Declaration

    Objective-C

    - (void)mapView:(TTMapView *_Nonnull)mapView
        didLongPress:(CLLocationCoordinate2D)coordinate;

    Swift

    optional func mapView(_ mapView: TTMapView, didLongPress coordinate: CLLocationCoordinate2D)

    Parameters

    mapView

    The map view.

    coordinate

    for a long press.

  • Tells the delegate that specified map view with rotate gesture recognizer.

    Declaration

    Objective-C

    - (void)mapView:(TTMapView *_Nonnull)mapView didRotate:(CGFloat)angle;

    Swift

    optional func mapView(_ mapView: TTMapView, didRotate angle: CGFloat)

    Parameters

    mapView

    The map view.

    angle

    in radians.