summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLAnnotationImage.h
blob: fbeee18624c3bed2524fa419b8d116cdf32268bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/**
 The `MGLAnnotationImage` class is responsible for presenting point-based
 annotations visually on a map view. Annotation image objects wrap `UIImage`
 objects and may be recycled later and put into a reuse queue that is maintained
 by the map view.
 */
@interface MGLAnnotationImage : NSObject <NSSecureCoding>

#pragma mark Initializing and Preparing the Image Object

/**
 Initializes and returns a new annotation image object.

 @param image The image to be displayed for the annotation.
 @param reuseIdentifier The string that identifies that this annotation image is
    reusable.
 @return The initialized annotation image object or `nil` if there was a problem
    initializing the object.
 */
+ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(NSString *)reuseIdentifier;

#pragma mark Getting and Setting Attributes

/** The image to be displayed for the annotation. */
@property (nonatomic, strong, nullable) UIImage *image;

/**
 The string that identifies that this annotation image is reusable. (read-only)

 You specify the reuse identifier when you create the image object. You use this
 type later to retrieve an annotation image object that was created previously
 but which is currently unused because its annotation is not on screen.

 If you define distinctly different types of annotations (with distinctly
 different annotation images to go with them), you can differentiate between the
 annotation types by specifying different reuse identifiers for each one.
 */
@property (nonatomic, readonly) NSString *reuseIdentifier;

/**
 A Boolean value indicating whether the annotation is enabled.

 The default value of this property is `YES`. If the value of this property is
 `NO`, the annotation image ignores touch events and cannot be selected.
 */
@property (nonatomic, getter=isEnabled) BOOL enabled;

@end

NS_ASSUME_NONNULL_END