SPAnnotationView
Objective-C
@interface SPAnnotationView
Swift
class SPAnnotationView
Extends MGLAnnotationView. Used as the default view for displaying point annotations on a map. Provides async image loading for marker icons.
-
Provides way to change the color of the annotation view background.
Declaration
Objective-C
@property (nonatomic, strong) UIColor *_Nonnull annotationColor; -
Change annotation type. Annotation types are drawn with different
Declaration
Objective-C
- (void)setAnnotationType:(SPAnnotationType)type;Swift
func setAnnotationType(_ type: Any!)Parameters
typeannotation type
-
Return Value
annotation type
-
Recommended constructor for SPAnnotationView objects. Allows the scaling of annotations, default scaling for annotations is 1.0.
Declaration
Objective-C
- (nonnull instancetype)initWithReuseIdentifier: (nonnull NSString *)reuseIdentifier scale:(CGFloat)scale type:(SPAnnotationType)type;Swift
init!(reuseIdentifier: Any!, scale: Any!, type: Any!)Parameters
reuseIdentifieridentifier for re-use
scalescale for annotation view
typeannotation type
-
Replaces contents of the annotation view with an image. You can use this to override default annotation view visuals.
Declaration
Objective-C
- (void)setImage:(nonnull UIImage *)image;Swift
func setImage(_ image: Any!)Parameters
imagethat will be displayed
-
Plays an animation.
Declaration
Objective-C
- (void)animate:(SPAnnotationViewAnimation)animation completion:(nullable void (^)(BOOL))completionBlock;Swift
func animate(_ animation: Any!) async -> Int32Parameters
animationanimation type
completionBlockcalled when animation finishes
-
Clears all annotation images stored in memory cache. The SDK will clear the cache automatically and most of the time you do not need to call this method.
Declaration
Objective-C
+ (void)clearImageCache;Swift
class func clearImageCache()
SPAnnotationView Class Reference