TTAnnotationManager

Objective-C

@protocol TTAnnotationManager <NSObject>

Swift

protocol TTAnnotationManager : NSObjectProtocol

TTAnnotationManager class to manage interactions with annotations.

  • Register delegate to receive annotations releated callbacks.

    Declaration

    Objective-C

    @property (nonatomic, weak) id<TTAnnotationDelegate> _Nullable delegate;

    Swift

    weak var delegate: TTAnnotationDelegate? { get set }
  • Contains array of all annotations that are attached to map.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<TTAnnotation *> *_Nonnull annotations;

    Swift

    var annotations: [TTAnnotation] { get }
  • Contains array of all overlays that are attached to map.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<TTOverlay *> *_Nonnull overlays;

    Swift

    var overlays: [TTOverlay] { get }

Clustering

  • Turn on / off markers clustering.

    Declaration

    Objective-C

    @property (nonatomic) BOOL clustering;

    Swift

    var clustering: Bool { get set }
    • Turn on / off markers clustering and provide custom parameters to customize the algorithm.

    Declaration

    Objective-C

    - (void)setClustering:(BOOL)custeringEnabled
               withRadius:(int)radius
                     with:(int)maxZoom;

    Swift

    func setClustering(_ custeringEnabled: Bool, withRadius radius: Int32, with maxZoom: Int32)

    Parameters

    custeringEnabled

    custeringEnabled

    radius

    radius

    maxZoom

    maxZoom

  • Display annotation on the map. If an annotation is already attached to map nothing happens. If you want to have two same annotations in one place you need to create a copy of given annotation.

    Declaration

    Objective-C

    - (void)addAnnotation:(TTAnnotation *_Nonnull)annotation;

    Swift

    func add(_ annotation: TTAnnotation)

    Parameters

    annotation

    TTAnnotation

  • Display annotations on the map. If an annotations are already attached to map nothing happens. If you want to have two same annotations in one place you need to create a copy of given annotation.

    Declaration

    Objective-C

    - (void)addAnnotations:(NSArray<TTAnnotation *> *_Nonnull)annotations;

    Swift

    func add(_ annotations: [TTAnnotation])

    Parameters

    annotations

    array of TTAnnotation

  • Remove given annotation from a map and set its ID to MARKER_ID_UNDEFINED. If an annotation is not attached to map, throws the exception.

    Declaration

    Objective-C

    - (void)removeAnnotation:(TTAnnotation *_Nonnull)annotation;

    Swift

    func remove(_ annotation: TTAnnotation)

    Parameters

    annotation

    TTAnnotation

  • Remove given annotations from map and set their ID to MARKER_ID_UNDEFINED. If any of annotation in the array is not attached to map, throws the exception.

    Declaration

    Objective-C

    - (void)removeAnnotations:(NSArray<TTAnnotation *> *_Nonnull)annotations;

    Swift

    func remove(_ annotations: [TTAnnotation])

    Parameters

    annotations

    array of TTAnnotations

  • Removes all annotations from the map.

    Declaration

    Objective-C

    - (void)removeAllAnnotations;

    Swift

    func removeAllAnnotations()
  • Only one annotation on the map can be selected. Annotation can be selected by calling this method explicitly or by tapping on a marker on the map. You cant select annotation that has NO set of property selectable.

    Declaration

    Objective-C

    - (void)selectAnnotation:(TTAnnotation *_Nonnull)annotation;

    Swift

    func select(_ annotation: TTAnnotation)

    Parameters

    annotation

    TTAnnotation

  • Deselect annotation if selected and remove callout if opened.

    Declaration

    Objective-C

    - (void)deselectAnnotation;

    Swift

    func deselectAnnotation()
  • Returns selected annotation if any otherwise nil is none is selected.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) TTAnnotation *_Nullable selectedAnnotation;

    Swift

    var selectedAnnotation: TTAnnotation? { get }

Overlay

  • Adds the overlay object to the map.

    Declaration

    Objective-C

    - (void)addOverlay:(TTOverlay *_Nonnull)overlay;

    Swift

    func add(_ overlay: TTOverlay)

    Parameters

    overlay

    An interface for associating content with a specific map region.

  • Removes an overlay object from the map.

    Declaration

    Objective-C

    - (void)removeOverlay:(TTOverlay *_Nonnull)overlay;

    Swift

    func remove(_ overlay: TTOverlay)

    Parameters

    overlay

    An interface for associating content with a specific map region.

  • Removes all overlays from the map.

    Declaration

    Objective-C

    - (void)removeAllOverlays;

    Swift

    func removeAllOverlays()

Zoom

  • Move the annotation to a different position

    Declaration

    Objective-C

    - (void)moveAnnotation:(TTAnnotation *_Nonnull)annotation
                toPosition:(CLLocationCoordinate2D)position;

    Swift

    func move(_ annotation: TTAnnotation, toPosition position: CLLocationCoordinate2D)

    Parameters

    annotation

    TTAnnotation obejct

    position

    CLLocationCoordinate2D coordinates of the new position

  • Change the image of the existing annotation

    Declaration

    Objective-C

    - (void)updateMarkerImage:(TTAnnotation *_Nonnull)annotation
                     newImage:(TTAnnotationImage *_Nonnull)image;

    Swift

    func updateMarkerImage(_ annotation: TTAnnotation, newImage image: TTAnnotationImage)

    Parameters

    annotation

    TTAnnotation obejct

    image

    TTAnnotationImage new image