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 }
-
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
custeringEnabledcusteringEnabled
radiusradius
maxZoommaxZoom
-
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
annotationTTAnnotation
-
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
annotationsarray 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
annotationTTAnnotation
-
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
annotationsarray 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
annotationTTAnnotation
-
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 }
-
Removes all overlays from the map.
Declaration
Objective-C
- (void)removeAllOverlays;Swift
func removeAllOverlays()
-
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
annotationTTAnnotation obejct
positionCLLocationCoordinate2D 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
annotationTTAnnotation obejct
imageTTAnnotationImage new image
TTAnnotationManager Protocol Reference