summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLAnnotation.h
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-04-23 10:35:59 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-04-23 10:35:59 -0700
commit3e22369f27ba4a0b1273c8934bfb0f59d9aa96c5 (patch)
tree9f0faeb5af456dc559b48d114883b2f6771400ba /platform/darwin/src/MGLAnnotation.h
parent2d32336a41dac77b6182642b7067a23add12eb09 (diff)
downloadqtlocation-mapboxgl-3e22369f27ba4a0b1273c8934bfb0f59d9aa96c5.tar.gz
[ios, osx] Eliminated platform/{ios,osx}/include
Also updated various project references to be group-relative, so Xcode chooses the right directory by default when adding a new file. Fixes #4770.
Diffstat (limited to 'platform/darwin/src/MGLAnnotation.h')
-rw-r--r--platform/darwin/src/MGLAnnotation.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLAnnotation.h b/platform/darwin/src/MGLAnnotation.h
new file mode 100644
index 0000000000..e4726f9503
--- /dev/null
+++ b/platform/darwin/src/MGLAnnotation.h
@@ -0,0 +1,48 @@
+#import <Foundation/Foundation.h>
+#import <CoreLocation/CoreLocation.h>
+#import <TargetConditionals.h>
+
+#import "MGLTypes.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.
+ */
+@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