TTAnnotation

Objective-C

@interface TTAnnotation : NSObject

Swift

class TTAnnotation : NSObject

The TTAnnotation class is used to provide annotation-related information to a map view. To use this class, you adopt it in any custom objects that store or represent annotation data. Annotation objects do not provide the visual representation of the annotation but typically coordinate.

  • Returns new instance of an image that is used by SDK as default annotation representation.

    Declaration

    Objective-C

    + (TTAnnotationImage *_Nonnull)defaultAnnotationImage;

    Swift

    class func defaultAnnotationImage() -> TTAnnotationImage

    Return Value

    TTAnnotationImage

  • Creates annotation placed on given location with default image

    Declaration

    Objective-C

    + (TTAnnotation *_Nonnull)annotationWithCoordinate:
        (CLLocationCoordinate2D)coordinate;

    Parameters

    coordinate

    coordinate of annotation

    Return Value

    TTAnnotation

  • Creates annotation placed on given location with default image The anchor allows specifying which point of an annotation image is attached to the map. The annotation will rotate around this anchoring point when rotating the map.

    Declaration

    Objective-C

    + (TTAnnotation *_Nonnull)annotationWithCoordinate:
                                  (CLLocationCoordinate2D)coordinate
                                                anchor:(TTAnnotationAnchor)anchor
                                                  type:(TTAnnotationType)type;

    Parameters

    coordinate

    coordinate of annotation

    anchor

    anchor determines how to attach image to coordinate

    type

    type determines how annotation is draw when rotating map

    Return Value

    TTAnnotation

  • Creates annotation placed on given location with provided image and anchor. The anchor allows specifying which point of an annotation image is attached to the map. The annotation will rotate around this anchoring point when rotating the map.

    Declaration

    Objective-C

    + (TTAnnotation *_Nonnull)
        annotationWithCoordinate:(CLLocationCoordinate2D)coordinate
                 annotationImage:(TTAnnotationImage *_Nonnull)image
                          anchor:(TTAnnotationAnchor)anchor
                            type:(TTAnnotationType)type;

    Parameters

    coordinate

    coordinate of annotation

    image

    image representation of annotation

    anchor

    anchor determines how to attach image to coordinate

    type

    type determines how annotation is draw when rotating map

    Return Value

    TTAnnotation

  • Creates annotation placed on given location with default image

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithCoordinate:(CLLocationCoordinate2D)coordinate;

    Swift

    init(coordinate: CLLocationCoordinate2D)

    Parameters

    coordinate

    coordinate of annotation

  • Creates annotation placed on given location with default image The anchor allows specifying which point of an annotation image is attached to the map. The annotation will rotate around this anchoring point when rotating the map.

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithCoordinate:(CLLocationCoordinate2D)coordinate
                                         anchor:(TTAnnotationAnchor)anchor
                                           type:(TTAnnotationType)type;

    Swift

    init(coordinate: CLLocationCoordinate2D, anchor: TTAnnotationAnchor, type: TTAnnotationType)

    Parameters

    coordinate

    coordinate of annotation

    anchor

    anchor determines how to attach image to coordinate

    type

    type determines how annotation is draw when rotating map

  • Creates annotation placed on given location with provided image and anchor. When you add a custom image for annotation you are forced to give it a tag. Tags are used to as keys in a map where images are stored. That saves a lot of memory when you want to add the same image for multiple annotations. The anchor allows specifying which point of an annotation image is attached to the map. The annotation will rotate around this anchoring point when rotating the map.

    Declaration

    Objective-C

    - (instancetype _Nonnull)initWithCoordinate:(CLLocationCoordinate2D)coordinate
                                annotationImage:(TTAnnotationImage *_Nonnull)image
                                         anchor:(TTAnnotationAnchor)anchor
                                           type:(TTAnnotationType)type;

    Swift

    init(coordinate: CLLocationCoordinate2D, annotationImage image: TTAnnotationImage, anchor: TTAnnotationAnchor, type: TTAnnotationType)

    Parameters

    coordinate

    coordinate of annotation

    image

    image representation of annotation

    anchor

    anchor determines how to attach image to coordinate

    type

    type determines how annotation is draw when rotating map

  • Location of annotation. Latitude between -90 - 90 and longitude -180 - 180

    Declaration

    Objective-C

    @property (nonatomic, readonly) CLLocationCoordinate2D coordinate;

    Swift

    var coordinate: CLLocationCoordinate2D { get }
  • Determines how an image of is attached to coordinates. E.g. Bottom will take center width, bottom height of the image and attach it to annotation location.

    Declaration

    Objective-C

    @property (nonatomic, readonly) TTAnnotationAnchor anchor;

    Swift

    var anchor: TTAnnotationAnchor { get }
  • Determines how an image of annotations behaves when map rotates.

    Declaration

    Objective-C

    @property (nonatomic, readonly) TTAnnotationType type;

    Swift

    var type: TTAnnotationType { get }
  • Determines if annotation can be selected either by manager select call or tapping on the map. By default annotations are selectable.

    Declaration

    Objective-C

    @property (nonatomic) BOOL selectable;

    Swift

    var selectable: Bool { get set }
  • Determines if an annotation is selected.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isSelected;

    Swift

    var isSelected: Bool { get }
  • Determines if can display callout or not when selected.

    Declaration

    Objective-C

    @property (nonatomic) BOOL canShowCallout;

    Swift

    var canShowCallout: Bool { get set }
  • NSString value that you can use to identify annotation object on your map.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull annotationTag;

    Swift

    var annotationTag: String { get }
  • Indicates whether annotation should clustered or not. If not, annotation will be skipped from clustering procedure when it is enabled.

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldCluster;

    Swift

    var shouldCluster: Bool { get set }
  • Indicates whether annotation is draggable.

    Declaration

    Objective-C

    @property (nonatomic) BOOL isDraggable;

    Swift

    var isDraggable: Bool { get set }
  • The current drag state of TTAnnotation.

    Declaration

    Objective-C

    @property (nonatomic, readonly) TTAnnotationDragState dragState;

    Swift

    var dragState: TTAnnotationDragState { get }