forked from mapbox/mapbox-gl-native-ios
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MGLAnnotation.h
65 lines (48 loc) · 2.11 KB
/
MGLAnnotation.h
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
55
56
57
58
59
60
61
62
63
64
65
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <TargetConditionals.h>
NS_ASSUME_NONNULL_BEGIN
/**
The `MGLAnnotation` protocol is used to provide annotation-related information
to a map view. To use this protocol, you adopt it in any custom objects that
store or represent annotation data. Each object then serves as the source of
information about a single map annotation and provides critical information,
such as the annotation’s location on the map. Annotation objects do not provide
the visual representation of the annotation but typically coordinate (in
conjunction with the map view’s delegate) the creation of an appropriate
objects to handle the display.
An object that adopts this protocol must implement the `coordinate` property.
The other methods of this protocol are optional.
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/annotation-models/">
Annotation models</a> and <a href="https://docs.mapbox.com/ios/maps/examples/annotation-views/">
Annotation views</a> examples to learn how to add objects that follow the
`MGLAnnotation` protocol.
*/
@protocol MGLAnnotation <NSObject>
#pragma mark Position Attributes
/**
The center point (specified as a map coordinate) of the annotation. (required)
(read-only)
*/
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@optional
#pragma mark Title Attributes
/**
The string containing the annotation’s title.
Although this property is optional, if you support the selection of annotations
in your map view, you are expected to provide this property. This string is
displayed in the callout for the associated annotation.
*/
@property (nonatomic, readonly, copy, nullable) NSString *title;
/**
The string containing the annotation’s subtitle.
This string is displayed in the callout for the associated annotation.
*/
@property (nonatomic, readonly, copy, nullable) NSString *subtitle;
#if !TARGET_OS_IPHONE
/** The string containing the annotation’s tooltip. */
@property (nonatomic, readonly, copy, nullable) NSString *toolTip;
#endif
@end
NS_ASSUME_NONNULL_END