summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.jazzy.yaml51
-rw-r--r--CHANGELOG.md1
-rw-r--r--include/mbgl/darwin/MGLAnnotation.h28
-rw-r--r--include/mbgl/darwin/MGLGeometry.h18
-rw-r--r--include/mbgl/darwin/MGLMapCamera.h15
-rw-r--r--include/mbgl/darwin/MGLMultiPoint.h9
-rw-r--r--include/mbgl/darwin/MGLOverlay.h41
-rw-r--r--include/mbgl/darwin/MGLPolygon.h11
-rw-r--r--include/mbgl/darwin/MGLPolyline.h11
-rw-r--r--include/mbgl/darwin/MGLStyle.h42
-rw-r--r--include/mbgl/darwin/MGLTypes.h1
-rw-r--r--include/mbgl/ios/MGLAccountManager.h31
-rw-r--r--include/mbgl/ios/MGLAnnotationImage.h37
-rw-r--r--include/mbgl/ios/MGLMapView.h958
-rw-r--r--include/mbgl/ios/MGLUserLocation.h20
-rw-r--r--platform/ios/INSTALL.md7
-rw-r--r--platform/ios/bitrise.yml3
-rwxr-xr-xplatform/ios/scripts/install.sh7
-rwxr-xr-xplatform/ios/scripts/package.sh49
19 files changed, 807 insertions, 533 deletions
diff --git a/.jazzy.yaml b/.jazzy.yaml
new file mode 100644
index 0000000000..35c4e9a8ec
--- /dev/null
+++ b/.jazzy.yaml
@@ -0,0 +1,51 @@
+module_name: Mapbox
+author_name: Mapbox
+author_url: https://www.mapbox.com/
+github_url: https://github.com/mapbox/mapbox-gl-native
+dash_url: https://www.mapbox.com/ios-sdk/docsets/Mapbox.xml
+copyright: '© 2014–2015 [Mapbox](https://www.mapbox.com/). See [license](https://github.com/mapbox/mapbox-gl-native/blob/master/LICENSE.md) for more details.'
+
+custom_head: |
+ <link rel='shortcut icon' href='http://www.mapbox.com/img/favicon.ico' type='image/x-icon' />
+
+objc_mode: Yes
+skip_undocumented: Yes
+hide_documentation_coverage: Yes
+umbrella_header: include/mbgl/ios/Mapbox.h
+framework_root: include/mbgl/darwin
+
+custom_categories:
+ - name: Map
+ children:
+ - MGLAccountManager
+ - MGLMapCamera
+ - MGLMapView
+ - MGLMapViewDelegate
+ - MGLStyle
+ - MGLUserTrackingMode
+ - name: Annotations
+ children:
+ - MGLAnnotation
+ - MGLAnnotationImage
+ - MGLMultiPoint
+ - MGLPointAnnotation
+ - MGLPolygon
+ - MGLPolyline
+ - MGLOverlay
+ - MGLShape
+ - MGLUserLocation
+ - name: Geometry
+ children:
+ - MGLCoordinateBounds
+ - MGLCoordinateBoundsEqualToCoordinateBounds
+ - MGLCoordinateBoundsGetCoordinateSpan
+ - MGLCoordinateBoundsIsEmpty
+ - MGLCoordinateBoundsMake
+ - MGLCoordinateBoundsOffset
+ - MGLCoordinateSpan
+ - MGLCoordinateSpanEqualToCoordinateSpan
+ - MGLCoordinateSpanMake
+ - MGLCoordinateSpanZero
+ - MGLDegreesFromRadians
+ - MGLRadiansFromDegrees
+ - MGLStringFromCoordinateBounds
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed2070a9df..91f094bc2e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -47,6 +47,7 @@ Known issues:
- Fixed an issue with small map views not properly fitting annotations within bounds. (#[3407](https://github.com/mapbox/mapbox-gl-native/pull/3407))
- The map will now snap to north. ([#3403](https://github.com/mapbox/mapbox-gl-native/pull/3403))
- The map view’s background can now be transparent or translucent, as long as the style’s background layer is transparent or translucent and `MGLMapView.opaque` is set to `NO`. ([#3096](https://github.com/mapbox/mapbox-gl-native/pull/3096))
+- Documentation is now generated by [jazzy](https://github.com/realm/jazzy) instead of appledoc. ♪♫ ([#3203](https://github.com/mapbox/mapbox-gl-native/pull/3203))
## iOS 3.0.1
diff --git a/include/mbgl/darwin/MGLAnnotation.h b/include/mbgl/darwin/MGLAnnotation.h
index 34b086f22e..e4726f9503 100644
--- a/include/mbgl/darwin/MGLAnnotation.h
+++ b/include/mbgl/darwin/MGLAnnotation.h
@@ -6,28 +6,34 @@
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. */
+/**
+ 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>
-/** @name Position Attributes */
+#pragma mark Position Attributes
/** The center point (specified as a map coordinate) of the annotation. (required) (read-only) */
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@optional
-/** @name Title Attributes */
+#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. */
+/**
+ 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. */
+/**
+ 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
diff --git a/include/mbgl/darwin/MGLGeometry.h b/include/mbgl/darwin/MGLGeometry.h
index 5337dca6b8..8d185805db 100644
--- a/include/mbgl/darwin/MGLGeometry.h
+++ b/include/mbgl/darwin/MGLGeometry.h
@@ -6,13 +6,15 @@
NS_ASSUME_NONNULL_BEGIN
-/** Defines the area spanned by an MGLCoordinateBounds. */
-typedef struct {
+/** Defines the area spanned by an `MGLCoordinateBounds`. */
+typedef struct MGLCoordinateSpan {
+ /** Latitudes spanned by an `MGLCoordinateBounds`. */
CLLocationDegrees latitudeDelta;
+ /** Longitudes spanned by an `MGLCoordinateBounds`. */
CLLocationDegrees longitudeDelta;
} MGLCoordinateSpan;
-/** Creates a new MGLCoordinateSpan from the given latitudinal and longitudinal deltas. */
+/** Creates a new `MGLCoordinateSpan` from the given latitudinal and longitudinal deltas. */
NS_INLINE MGLCoordinateSpan MGLCoordinateSpanMake(CLLocationDegrees latitudeDelta, CLLocationDegrees longitudeDelta) {
MGLCoordinateSpan span;
span.latitudeDelta = latitudeDelta;
@@ -30,12 +32,14 @@ NS_INLINE BOOL MGLCoordinateSpanEqualToCoordinateSpan(MGLCoordinateSpan span1, M
extern const MGLCoordinateSpan MGLCoordinateSpanZero;
/** A rectangular area as measured on a two-dimensional map projection. */
-typedef struct {
+typedef struct MGLCoordinateBounds {
+ /** Coordinate at the southwest corner. */
CLLocationCoordinate2D sw;
+ /** Coordinate at the northeast corner. */
CLLocationCoordinate2D ne;
} MGLCoordinateBounds;
-/** Creates a new MGLCoordinateBounds structure from the given southwest and northeast coordinates. */
+/** Creates a new `MGLCoordinateBounds` structure from the given southwest and northeast coordinates. */
NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsMake(CLLocationCoordinate2D sw, CLLocationCoordinate2D ne) {
MGLCoordinateBounds bounds;
bounds.sw = sw;
@@ -68,8 +72,8 @@ NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsOffset(MGLCoordinateBounds boun
}
/** Returns `YES` if the coordinate bounds covers no area.
-*
-* Note that a bounds may be empty but have a non-zero coordinate span (e.g., when its northeast point lies due north of its southwest point). */
+
+ Note that a bounds may be empty but have a non-zero coordinate span (e.g., when its northeast point lies due north of its southwest point). */
NS_INLINE BOOL MGLCoordinateBoundsIsEmpty(MGLCoordinateBounds bounds) {
MGLCoordinateSpan span = MGLCoordinateBoundsGetCoordinateSpan(bounds);
return span.latitudeDelta == 0 || span.longitudeDelta == 0;
diff --git a/include/mbgl/darwin/MGLMapCamera.h b/include/mbgl/darwin/MGLMapCamera.h
index 7c00ad8665..3cb902ba52 100644
--- a/include/mbgl/darwin/MGLMapCamera.h
+++ b/include/mbgl/darwin/MGLMapCamera.h
@@ -24,10 +24,25 @@ NS_ASSUME_NONNULL_BEGIN
/** Returns a new camera with all properties set to 0. */
+ (instancetype)camera;
+/**
+ Returns a new camera using based on information about the camera’s viewpoint and focus point.
+
+ @param centerCoordinate The geographic coordinate on which the map should be centered.
+ @param eyeCoordinate The geometric coordinate at which the camera should be situated.
+ @param eyeAltitude The altitude (measured in meters) above the map at which the camera should be situated. The altitude may be less than the distance from the camera’s viewpoint to the camera’s focus point.
+ */
+ (instancetype)cameraLookingAtCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
fromEyeCoordinate:(CLLocationCoordinate2D)eyeCoordinate
eyeAltitude:(CLLocationDistance)eyeAltitude;
+/**
+ Returns a new camera with the given distance, pitch, and heading.
+
+ @param centerCoordinate The geographic coordinate on which the map should be centered.
+ @param distance The straight-line distance from the viewpoint to the `centerCoordinate`.
+ @param pitch The viewing angle of the camera, measured in degrees. A value of `0` results in a camera pointed straight down at the map. Angles greater than `0` result in a camera angled toward the horizon.
+ @param heading The camera’s heading, measured in degrees clockwise from true north. A value of `0` means that the top edge of the map view corresponds to true north. The value `90` means the top of the map is pointing due east. The value `180` means the top of the map points due south, and so on.
+ */
+ (instancetype)cameraLookingAtCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
fromDistance:(CLLocationDistance)distance
pitch:(CGFloat)pitch
diff --git a/include/mbgl/darwin/MGLMultiPoint.h b/include/mbgl/darwin/MGLMultiPoint.h
index 5c58016df4..ad9db1e681 100644
--- a/include/mbgl/darwin/MGLMultiPoint.h
+++ b/include/mbgl/darwin/MGLMultiPoint.h
@@ -13,9 +13,12 @@ NS_ASSUME_NONNULL_BEGIN
/** The number of points associated with the shape. (read-only) */
@property (nonatomic, readonly) NSUInteger pointCount;
-/** Retrieves one or more coordinates associated with the shape.
-* @param coords On input, you must provide a C array of structures large enough to hold the desired number of coordinates. On output, this structure contains the requested coordinate data.
-* @param range The range of points you want. The `location` field indicates the first point you are requesting, with `0` being the first point, `1` being the second point, and so on. The `length` field indicates the number of points you want. The array in _`coords`_ must be large enough to accommodate the number of requested coordinates. */
+/**
+ Retrieves one or more coordinates associated with the shape.
+
+ @param coords On input, you must provide a C array of structures large enough to hold the desired number of coordinates. On output, this structure contains the requested coordinate data.
+ @param range The range of points you want. The `location` field indicates the first point you are requesting, with `0` being the first point, `1` being the second point, and so on. The `length` field indicates the number of points you want. The array in _`coords`_ must be large enough to accommodate the number of requested coordinates.
+ */
- (void)getCoordinates:(CLLocationCoordinate2D *)coords range:(NSRange)range;
@end
diff --git a/include/mbgl/darwin/MGLOverlay.h b/include/mbgl/darwin/MGLOverlay.h
index ab827c0d22..aa80fe3900 100644
--- a/include/mbgl/darwin/MGLOverlay.h
+++ b/include/mbgl/darwin/MGLOverlay.h
@@ -8,28 +8,37 @@
NS_ASSUME_NONNULL_BEGIN
-/** The `MGLOverlay` protocol defines a specific type of annotation that represents both a point and an area on a map. Overlay objects are essentially data objects that contain the geographic data needed to represent the map area. For example, overlays can take the form of common shapes such as rectangles and circles. They can also describe polygons and other complex shapes.
-*
-* You use overlays to layer more sophisticated content on top of a map view. For example, you could use an overlay to show the boundaries of a national park or trace a bus route along city streets. The Mapbox iOS SDK defines several concrete classes that conform to this protocol and define standard shapes.
-*
-* Because overlays are also annotations, they have similar usage pattern to annotations. When added to a map view using the `addOverlay:` method, that view detects whenever the overlay’s defined region intersects the visible portion of the map. At that point, the map view asks its delegate to provide a special overlay view to draw the visual representation of the overlay. If you add an overlay to a map view as an annotation instead, it is treated as an annotation with a single point. */
+/**
+ The `MGLOverlay` protocol defines a specific type of annotation that represents both a point and an area on a map. Overlay objects are essentially data objects that contain the geographic data needed to represent the map area. For example, overlays can take the form of common shapes such as rectangles and circles. They can also describe polygons and other complex shapes.
+
+ You use overlays to layer more sophisticated content on top of a map view. For example, you could use an overlay to show the boundaries of a national park or trace a bus route along city streets. The Mapbox iOS SDK defines several concrete classes that conform to this protocol and define standard shapes.
+
+ Because overlays are also annotations, they have similar usage pattern to annotations. When added to a map view using the `-addOverlay:` method, that view detects whenever the overlay’s defined region intersects the visible portion of the map. At that point, the map view asks its delegate to provide a special overlay view to draw the visual representation of the overlay. If you add an overlay to a map view as an annotation instead, it is treated as an annotation with a single point.
+ */
@protocol MGLOverlay <MGLAnnotation>
-/* The approximate center point of the overlay area. (required) (read-only)
-*
-* This point is typically set to the center point of the map’s bounding rectangle. It is used as the anchor point for any callouts displayed for the annotation. */
+/**
+ The approximate center point of the overlay area. (required) (read-only)
+
+ This point is typically set to the center point of the map’s bounding rectangle. It is used as the anchor point for any callouts displayed for the annotation.
+ */
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
-/** The cooordinate rectangle that encompasses the overlay. (required) (read-only)
-*
-* This property contains the smallest rectangle that completely encompasses the overlay. Implementers of this protocol must set this area when implementing their overlay class, and after setting it, you must not change it. */
+/**
+ The cooordinate rectangle that encompasses the overlay. (required) (read-only)
+
+ This property contains the smallest rectangle that completely encompasses the overlay. Implementers of this protocol must set this area when implementing their overlay class, and after setting it, you must not change it.
+ */
@property (nonatomic, readonly) MGLCoordinateBounds overlayBounds;
-/** Returns a Boolean indicating whether the specified rectangle intersects the receiver’s shape.
-*
-* You can implement this method to provide more specific bounds checking for an overlay. If you do not implement it, the bounding rectangle is used to detect intersections.
-* @param overlayBounds The rectangle to intersect with the receiver’s area.
-* @return `YES` if any part of the map rectangle intersects the receiver’s shape or `NO` if it does not. */
+/**
+ Returns a Boolean indicating whether the specified rectangle intersects the receiver’s shape.
+
+ You can implement this method to provide more specific bounds checking for an overlay. If you do not implement it, the bounding rectangle is used to detect intersections.
+
+ @param overlayBounds The rectangle to intersect with the receiver’s area.
+ @return `YES` if any part of the map rectangle intersects the receiver’s shape or `NO` if it does not.
+ */
- (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds;
@end
diff --git a/include/mbgl/darwin/MGLPolygon.h b/include/mbgl/darwin/MGLPolygon.h
index a19b984f1c..c5480264fb 100644
--- a/include/mbgl/darwin/MGLPolygon.h
+++ b/include/mbgl/darwin/MGLPolygon.h
@@ -11,10 +11,13 @@ NS_ASSUME_NONNULL_BEGIN
/** The `MGLPolygon` class represents a shape consisting of one or more points that define a closed polygon. The points are connected end-to-end in the order they are provided. The first and last points are connected to each other to create the closed shape. */
@interface MGLPolygon : MGLMultiPoint <MGLOverlay>
-/** Creates and returns an `MGLPolygon` object from the specified set of coordinates.
-* @param coords The array of coordinates defining the shape. The data in this array is copied to the new object.
-* @param count The number of items in the _`coords`_ array.
-* @return A new polygon object. */
+/**
+ Creates and returns an `MGLPolygon` object from the specified set of coordinates.
+
+ @param coords The array of coordinates defining the shape. The data in this array is copied to the new object.
+ @param count The number of items in the `coords` array.
+ @return A new polygon object.
+ */
+ (instancetype)polygonWithCoordinates:(CLLocationCoordinate2D *)coords
count:(NSUInteger)count;
diff --git a/include/mbgl/darwin/MGLPolyline.h b/include/mbgl/darwin/MGLPolyline.h
index c849bc9876..c28299c7e0 100644
--- a/include/mbgl/darwin/MGLPolyline.h
+++ b/include/mbgl/darwin/MGLPolyline.h
@@ -11,10 +11,13 @@ NS_ASSUME_NONNULL_BEGIN
/** The `MGLPolyline` class represents a shape consisting of one or more points that define connecting line segments. The points are connected end-to-end in the order they are provided. The first and last points are not connected to each other. */
@interface MGLPolyline : MGLMultiPoint <MGLOverlay>
-/** Creates and returns an `MGLPolyline` object from the specified set of coordinates.
-* @param coords The array of coordinates defining the shape. The data in this array is copied to the new object.
-* @param count The number of items in the _`coords`_ array.
-* @return A new polyline object. */
+/**
+ Creates and returns an `MGLPolyline` object from the specified set of coordinates.
+
+ @param coords The array of coordinates defining the shape. The data in this array is copied to the new object.
+ @param count The number of items in the `coords` array.
+ @return A new polyline object.
+ */
+ (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords
count:(NSUInteger)count;
diff --git a/include/mbgl/darwin/MGLStyle.h b/include/mbgl/darwin/MGLStyle.h
index 88cb8aaa83..e5b2de877c 100644
--- a/include/mbgl/darwin/MGLStyle.h
+++ b/include/mbgl/darwin/MGLStyle.h
@@ -7,28 +7,46 @@ NS_ASSUME_NONNULL_BEGIN
/** A collection of convenience methods for creating style URLs of default styles provided by Mapbox. These instances of NSURL are cached. */
@interface MGLStyle : NSObject
-/** Returns the Streets style URL.
-* Mapbox Streets is a complete base map, perfect for incorporating your own data. */
+/**
+ Returns the Streets style URL.
+
+ Mapbox Streets is a complete base map, perfect for incorporating your own data.
+ */
+ (NSURL *)streetsStyleURL;
-/** Returns the Emerald style URL.
-* Emerald is a versatile style with emphasis on road networks and public transportation. */
+/**
+ Returns the Emerald style URL.
+
+ Emerald is a versatile style with emphasis on road networks and public transportation.
+ */
+ (NSURL *)emeraldStyleURL;
-/** Returns the Light style URL.
-* Light is a subtle, light-colored backdrop for data visualizations. */
+/**
+ Returns the Light style URL.
+
+ Light is a subtle, light-colored backdrop for data visualizations.
+ */
+ (NSURL *)lightStyleURL;
-/** Returns the Dark style URL.
-* Dark is a subtle, dark-colored backdrop for data visualizations. */
+/**
+ Returns the Dark style URL.
+
+ Dark is a subtle, dark-colored backdrop for data visualizations.
+ */
+ (NSURL *)darkStyleURL;
-/** Returns the Satellite style URL.
-* Mapbox Satellite is a beautiful global satellite and aerial imagery layer. */
+/**
+ Returns the Satellite style URL.
+
+ Mapbox Satellite is a beautiful global satellite and aerial imagery layer.
+ */
+ (NSURL *)satelliteStyleURL;
-/** Returns the Hybrid style URL.
-* Hybrid combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels. */
+/**
+ Returns the Hybrid style URL.
+
+ Hybrid combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels.
+ */
+ (NSURL *)hybridStyleURL;
- (instancetype)init NS_UNAVAILABLE;
diff --git a/include/mbgl/darwin/MGLTypes.h b/include/mbgl/darwin/MGLTypes.h
index b86ecc35e6..c107055dbb 100644
--- a/include/mbgl/darwin/MGLTypes.h
+++ b/include/mbgl/darwin/MGLTypes.h
@@ -12,6 +12,7 @@
NS_ASSUME_NONNULL_BEGIN
+/** Indicates an error occurred in the Mapbox SDK. */
extern NSString * const MGLErrorDomain;
/** The mode used to track the user location on the map. */
diff --git a/include/mbgl/ios/MGLAccountManager.h b/include/mbgl/ios/MGLAccountManager.h
index 4c239d6a1f..2b3b1784f6 100644
--- a/include/mbgl/ios/MGLAccountManager.h
+++ b/include/mbgl/ios/MGLAccountManager.h
@@ -7,23 +7,30 @@ NS_ASSUME_NONNULL_BEGIN
/** The MGLAccountManager object provides a global way to set a Mapbox API access token, as well as other settings used framework-wide. */
@interface MGLAccountManager : NSObject
-/** @name Authorizing Access */
-
-/** Set the Mapbox API access token for the framework.
-*
-* You can set an access token on MGLAccountManager or on an individual map view. The same token is used throughout the framework.
-* @param accessToken The Mapbox API access token. */
+#pragma mark Authorizing Access
+
+/**
+ Set the Mapbox API access token for the framework.
+
+ You can set an access token on MGLAccountManager or on an individual map view. The same token is used throughout the framework.
+ @param accessToken The Mapbox API access token.
+ */
+ (void)setAccessToken:(nullable NSString *)accessToken;
-/** Retreive the Mapbox API access token for the framework.
-*
-* You can set an access token on MGLAccountManager or on an individual map view. The same token is used throughout the framework.
-* @return accessToken The Mapbox API access token. */
+/**
+ Retreive the Mapbox API access token for the framework.
+
+ You can set an access token on MGLAccountManager or on an individual map view. The same token is used throughout the framework.
+
+ @return accessToken The Mapbox API access token.
+ */
+ (nullable NSString *)accessToken;
-/** @name Providing User Metrics Opt-Out */
+#pragma mark Providing User Metrics Opt-Out
-/** Whether in-app user metrics opt-out is configured. If set to the default value of `NO`, a user opt-out preference is expected in a `Settings.bundle` that shows in the application's section within the system Settings app. */
+/**
+ Whether in-app user metrics opt-out is configured. If set to the default value of `NO`, a user opt-out preference is expected in a `Settings.bundle` that shows in the application's section within the system Settings app.
+ */
+ (BOOL)mapboxMetricsEnabledSettingShownInApp;
@end
diff --git a/include/mbgl/ios/MGLAnnotationImage.h b/include/mbgl/ios/MGLAnnotationImage.h
index f48a3cfb45..f9d9e70566 100644
--- a/include/mbgl/ios/MGLAnnotationImage.h
+++ b/include/mbgl/ios/MGLAnnotationImage.h
@@ -7,29 +7,36 @@ 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
-/** @name 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. */
+#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;
-/** @name Getting and Setting Attributes */
+#pragma mark Getting and Setting Attributes
/** The image to be displayed for the annotation. */
@property (nonatomic, strong) 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. */
+/**
+ 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. */
+/**
+ 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
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h
index ebf7509a31..88c27d160b 100644
--- a/include/mbgl/ios/MGLMapView.h
+++ b/include/mbgl/ios/MGLMapView.h
@@ -18,59 +18,71 @@ NS_ASSUME_NONNULL_BEGIN
@protocol MGLAnnotation;
@protocol MGLOverlay;
-/** An MGLMapView object provides an embeddable map interface, similar to the one provided by Apple's MapKit. You use this class to display map information and to manipulate the map contents from your application. You can center the map on a given coordinate, specify the size of the area you want to display, and style the features of the map to fit your application's use case.
-*
-* Use of MGLMapView requires a Mapbox API access token. Obtain an access token on the [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). If you instantiate an MGLMapView from Interface Builder, rendering of the map won't begin until the accessToken property has been set.
-*
-* @warning Please note that you are responsible for getting permission to use the map data, and for ensuring your use adheres to the relevant terms of use. */
+/**
+ An MGLMapView object provides an embeddable map interface, similar to the one provided by Apple's MapKit. You use this class to display map information and to manipulate the map contents from your application. You can center the map on a given coordinate, specify the size of the area you want to display, and style the features of the map to fit your application's use case.
+
+ Use of MGLMapView requires a Mapbox API access token. Obtain an access token on the [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). If you instantiate an MGLMapView from Interface Builder, rendering of the map won't begin until the accessToken property has been set.
+
+ @warning Please note that you are responsible for getting permission to use the map data, and for ensuring your use adheres to the relevant terms of use.
+ */
IB_DESIGNABLE
@interface MGLMapView : UIView
-#pragma mark - Initializing a Map View
+#pragma mark Initializing a Map View
-/** @name Initializing a Map View */
-
-/** Initializes and returns a newly allocated map view with the specified frame and the default style.
-* @param frame The frame for the view, measured in points.
-* @return An initialized map view. */
+/**
+ Initializes and returns a newly allocated map view with the specified frame and the default style.
+
+ @param frame The frame for the view, measured in points.
+ @return An initialized map view.
+ */
- (instancetype)initWithFrame:(CGRect)frame;
-/** Initializes and returns a newly allocated map view with the specified frame and style URL.
-* @param frame The frame for the view, measured in points.
-* @param styleURL The map style URL to use. Can be either an HTTP/HTTPS URL or a Mapbox map ID style URL (`mapbox://styles/<user>/<style>`). Specify `nil` for the default style.
-* @return An initialized map view. */
+/**
+ Initializes and returns a newly allocated map view with the specified frame and style URL.
+
+ @param frame The frame for the view, measured in points.
+ @param styleURL The map style URL to use. Can be either an HTTP/HTTPS URL or a Mapbox map ID style URL (`mapbox://styles/my_user_name/abcd1234`). Specify `nil` for the default style.
+ @return An initialized map view.
+ */
- (instancetype)initWithFrame:(CGRect)frame styleURL:(nullable NSURL *)styleURL;
-#pragma mark - Accessing Map Properties
-
-/** @name Accessing Map Properties */
+#pragma mark Accessing Map Properties
-/** A Boolean value that determines whether the user may zoom the map.
-*
-* This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still change the map zoom programmatically.
-*
-* The default value of this property is `YES`. */
+/**
+ A Boolean value that determines whether the user may zoom the map.
+
+ This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still change the map zoom programmatically.
+
+ The default value of this property is `YES`.
+ */
@property(nonatomic, getter=isZoomEnabled) BOOL zoomEnabled;
-/** A Boolean value that determines whether the user may scroll around the map.
-*
-* This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still change the map location programmatically.
-*
-* The default value of this property is `YES`. */
+/**
+ A Boolean value that determines whether the user may scroll around the map.
+
+ This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still change the map location programmatically.
+
+ The default value of this property is `YES`.
+ */
@property(nonatomic, getter=isScrollEnabled) BOOL scrollEnabled;
-/** A Boolean value that determines whether the user may rotate the map.
-*
-* This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still rotate the map programmatically.
-*
-* The default value of this property is `YES`. */
+/**
+ A Boolean value that determines whether the user may rotate the map.
+
+ This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still rotate the map programmatically.
+
+ The default value of this property is `YES`.
+ */
@property(nonatomic, getter=isRotateEnabled) BOOL rotateEnabled;
-/** A Boolean value that determines whether the user may change the pitch (tilt) of the map.
- *
- * This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still change the pitch of the map programmatically.
- *
- * The default value of this property is `YES`. */
+/**
+ A Boolean value that determines whether the user may change the pitch (tilt) of the map.
+
+ This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still change the pitch of the map programmatically.
+
+ The default value of this property is `YES`.
+ */
@property(nonatomic, getter=isPitchEnabled) BOOL pitchEnabled;
/** The compass image view shown in the upper-right when the map is rotated. */
@@ -82,116 +94,153 @@ IB_DESIGNABLE
/** The button shown in the lower-right of the map which when pressed displays the map attribution information. */
@property (nonatomic, readonly) UIButton *attributionButton;
-#pragma mark - Accessing the Delegate
-
-/** @name Accessing the Delegate */
+#pragma mark Accessing the Delegate
// TODO
@property(nonatomic, weak, nullable) IBOutlet id<MGLMapViewDelegate> delegate;
-#pragma mark - Manipulating the Visible Portion of the Map
+#pragma mark Manipulating the Visible Portion of the Map
-/** @name Manipulating the Visible Portion of the Map */
-
-/** The map coordinate at the center of the map view.
-*
-* Changing the value in this property centers the map on the new coordinate without changing the current zoom level.
-*
-* Changing the value of this property updates the map view immediately. If you want to animate the change, use the setCenterCoordinate:animated: method instead. */
+/**
+ The map coordinate at the center of the map view.
+
+ Changing the value in this property centers the map on the new coordinate without changing the current zoom level.
+
+ Changing the value of this property updates the map view immediately. If you want to animate the change, use the `-setCenterCoordinate:animated:` method instead.
+ */
@property (nonatomic) CLLocationCoordinate2D centerCoordinate;
-/** Changes the center coordinate of the map and optionally animates the change.
-* @param coordinate The new center coordinate for the map.
-* @param animated Specify `YES` if you want the map view to scroll to the new location or `NO` if you want the map to display the new location immediately.
-*
-* Changing the center coordinate centers the map on the new coordinate without changing the current zoom level. */
+/**
+ Changes the center coordinate of the map and optionally animates the change.
+
+ @param coordinate The new center coordinate for the map.
+ @param animated Specify `YES` if you want the map view to scroll to the new location or `NO` if you want the map to display the new location immediately.
+
+ Changing the center coordinate centers the map on the new coordinate without changing the current zoom level.
+ */
- (void)setCenterCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated;
-/** The zoom level of the map view.
-*
-* Changing the value in this property zooms the map in or out without changing the center coordinate. At zoom level 0, tiles cover the entire world map; at zoom level 1, tiles cover 1/4 of the world; at zoom level 2, tiles cover 1/16 of the world, and so on.
-*
-* Changing the value of this property updates the map view immediately. If you want to animate the change, use the setZoomLevel:animated: method instead. */
+/**
+ The zoom level of the map view.
+
+ Changing the value in this property zooms the map in or out without changing the center coordinate. At zoom level 0, tiles cover the entire world map; at zoom level 1, tiles cover 1/4 of the world; at zoom level 2, tiles cover 1/16 of the world, and so on.
+
+ Changing the value of this property updates the map view immediately. If you want to animate the change, use the `-setZoomLevel:animated:` method instead.
+ */
@property (nonatomic) double zoomLevel;
-/** Changes the zoom level of the map and optionally animates the change.
-* @param zoomLevel The new zoom level for the map.
-* @param animated Specify `YES` if you want the map view to animate the change to the new zoom level or `NO` if you want the map to display the new zoom level immediately.
-*
-* Changing the zoom level scales the map without changing the current center coordinate. At zoom level 0, tiles cover the entire world map; at zoom level 1, tiles cover 1/4 of the world; at zoom level 2, tiles cover 1/16 of the world, and so on. */
+/**
+ Changes the zoom level of the map and optionally animates the change.
+
+ @param zoomLevel The new zoom level for the map.
+ @param animated Specify `YES` if you want the map view to animate the change to the new zoom level or `NO` if you want the map to display the new zoom level immediately.
+
+ Changing the zoom level scales the map without changing the current center coordinate. At zoom level 0, tiles cover the entire world map; at zoom level 1, tiles cover 1/4 of the world; at zoom level 2, tiles cover 1/16 of the world, and so on.
+ */
- (void)setZoomLevel:(double)zoomLevel animated:(BOOL)animated;
-/** Changes the center coordinate and zoom level of the map and optionally animates the change.
-* @param centerCoordinate The new center coordinate for the map.
-* @param zoomLevel The new zoom level for the map.
-* @param animated Specify `YES` if you want the map view to animate scrolling and zooming to the new location or `NO` if you want the map to display the new location immediately. */
+/**
+ Changes the center coordinate and zoom level of the map and optionally animates the change.
+
+ @param centerCoordinate The new center coordinate for the map.
+ @param zoomLevel The new zoom level for the map.
+ @param animated Specify `YES` if you want the map view to animate scrolling and zooming to the new location or `NO` if you want the map to display the new location immediately.
+ */
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel animated:(BOOL)animated;
-/** Changes the center coordinate, zoom level, and direction of the map and optionally animates the change.
-* @param centerCoordinate The new center coordinate for the map.
-* @param zoomLevel The new zoom level for the map.
-* @param direction The new direction for the map, measured in degrees relative to true north.
-* @param animated Specify `YES` if you want the map view to animate scrolling, zooming, and rotating to the new location or `NO` if you want the map to display the new location immediately. */
+/**
+ Changes the center coordinate, zoom level, and direction of the map and optionally animates the change.
+
+ @param centerCoordinate The new center coordinate for the map.
+ @param zoomLevel The new zoom level for the map.
+ @param direction The new direction for the map, measured in degrees relative to true north.
+ @param animated Specify `YES` if you want the map view to animate scrolling, zooming, and rotating to the new location or `NO` if you want the map to display the new location immediately.
+ */
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel direction:(CLLocationDirection)direction animated:(BOOL)animated;
-/** Changes the center coordinate, zoom level, and direction of the map, calling a completion handler at the end of an optional animation.
-* @param centerCoordinate The new center coordinate for the map.
-* @param zoomLevel The new zoom level for the map.
-* @param direction The new direction for the map, measured in degrees relative to true north.
-* @param animated Specify `YES` if you want the map view to animate scrolling, zooming, and rotating to the new location or `NO` if you want the map to display the new location immediately.
-* @param completion The block executed after the animation finishes. */
+/**
+ Changes the center coordinate, zoom level, and direction of the map, calling a completion handler at the end of an optional animation.
+
+ @param centerCoordinate The new center coordinate for the map.
+ @param zoomLevel The new zoom level for the map.
+ @param direction The new direction for the map, measured in degrees relative to true north.
+ @param animated Specify `YES` if you want the map view to animate scrolling, zooming, and rotating to the new location or `NO` if you want the map to display the new location immediately.
+ @param completion The block executed after the animation finishes.
+ */
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel direction:(CLLocationDirection)direction animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
-/** The coordinate bounds visible in the receiver’s viewport.
-*
-* Changing the value of this property updates the receiver immediately. If you want to animate the change, call `setVisibleCoordinateBounds:animated:` instead. */
+/**
+ The coordinate bounds visible in the receiver’s viewport.
+
+ Changing the value of this property updates the receiver immediately. If you want to animate the change, call `-setVisibleCoordinateBounds:animated:` instead.
+ */
@property (nonatomic) MGLCoordinateBounds visibleCoordinateBounds;
-/** Changes the receiver’s viewport to fit the given coordinate bounds, optionally animating the change.
-* @param bounds The bounds that the viewport will show in its entirety.
-* @param animated Specify `YES` to animate the change by smoothly scrolling and zooming or `NO` to immediately display the given bounds. */
+/**
+ Changes the receiver’s viewport to fit the given coordinate bounds, optionally animating the change.
+
+ @param bounds The bounds that the viewport will show in its entirety.
+ @param animated Specify `YES` to animate the change by smoothly scrolling and zooming or `NO` to immediately display the given bounds.
+ */
- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds animated:(BOOL)animated;
-/** Changes the receiver’s viewport to fit the given coordinate bounds and optionally some additional padding on each side.
-* @param bounds The bounds that the viewport will show in its entirety.
-* @param insets The minimum padding (in screen points) that will be visible around the given coordinate bounds.
-* @param animated Specify `YES` to animate the change by smoothly scrolling and zooming or `NO` to immediately display the given bounds. */
+/**
+ Changes the receiver’s viewport to fit the given coordinate bounds and optionally some additional padding on each side.
+
+ @param bounds The bounds that the viewport will show in its entirety.
+ @param insets The minimum padding (in screen points) that will be visible around the given coordinate bounds.
+ @param animated Specify `YES` to animate the change by smoothly scrolling and zooming or `NO` to immediately display the given bounds.
+ */
- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
-/** Changes the receiver’s viewport to fit all of the given coordinates and optionally some additional padding on each side.
-* @param coordinates The coordinates that the viewport will show.
-* @param count The number of coordinates. This number must not be greater than the number of elements in `coordinates`.
-* @param insets The minimum padding (in screen points) that will be visible around the given coordinate bounds.
-* @param animated Specify `YES` to animate the change by smoothly scrolling and zooming or `NO` to immediately display the given bounds. */
+/**
+ Changes the receiver’s viewport to fit all of the given coordinates and optionally some additional padding on each side.
+
+ @param coordinates The coordinates that the viewport will show.
+ @param count The number of coordinates. This number must not be greater than the number of elements in `coordinates`.
+ @param insets The minimum padding (in screen points) that will be visible around the given coordinate bounds.
+ @param animated Specify `YES` to animate the change by smoothly scrolling and zooming or `NO` to immediately display the given bounds.
+ */
- (void)setVisibleCoordinates:(CLLocationCoordinate2D *)coordinates count:(NSUInteger)count edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
-/** Changes the receiver’s viewport to fit all of the given coordinates and optionally some additional padding on each side.
-* @param coordinates The coordinates that the viewport will show.
-* @param count The number of coordinates. This number must not be greater than the number of elements in `coordinates`.
-* @param insets The minimum padding (in screen points) that will be visible around the given coordinate bounds.
-* @param direction The direction to rotate the map to, measured in degrees relative to true north.
-* @param duration The duration to animate the change in seconds.
-* @param function The timing function to animate the change.
-* @param completion The block executed after the animation finishes. */
+/**
+ Changes the receiver’s viewport to fit all of the given coordinates and optionally some additional padding on each side.
+
+ @param coordinates The coordinates that the viewport will show.
+ @param count The number of coordinates. This number must not be greater than the number of elements in `coordinates`.
+ @param insets The minimum padding (in screen points) that will be visible around the given coordinate bounds.
+ @param direction The direction to rotate the map to, measured in degrees relative to true north.
+ @param duration The duration to animate the change in seconds.
+ @param function The timing function to animate the change.
+ @param completion The block executed after the animation finishes.
+ */
- (void)setVisibleCoordinates:(CLLocationCoordinate2D *)coordinates count:(NSUInteger)count edgePadding:(UIEdgeInsets)insets direction:(CLLocationDirection)direction duration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion;
-/** Sets the visible region so that the map displays the specified annotations.
-*
-* Calling this method updates the value in the visibleCoordinateBounds property and potentially other properties to reflect the new map region.
-* @param annotations The annotations that you want to be visible in the map.
-* @param animated `YES` if you want the map region change to be animated, or `NO` if you want the map to display the new region immediately without animations. */
+/**
+ Sets the visible region so that the map displays the specified annotations.
+
+ Calling this method updates the value in the visibleCoordinateBounds property and potentially other properties to reflect the new map region.
+
+ @param annotations The annotations that you want to be visible in the map.
+ @param animated `YES` if you want the map region change to be animated, or `NO` if you want the map to display the new region immediately without animations.
+ */
- (void)showAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations animated:(BOOL)animated;
-/** The heading of the map (measured in degrees) relative to true north.
-*
-* The value `0` means that the top edge of the map view corresponds to true north. The value `90` means the top of the map is pointing due east. The value `180` means the top of the map points due south, and so on. */
+/**
+ The heading of the map (measured in degrees) relative to true north.
+
+ The value `0` means that the top edge of the map view corresponds to true north. The value `90` means the top of the map is pointing due east. The value `180` means the top of the map points due south, and so on.
+ */
@property (nonatomic) CLLocationDirection direction;
-/** Changes the heading of the map and optionally animates the changes.
-* @param direction The heading of the map (measured in degrees) relative to true north.
-* @param animated Specify `YES` if you want the map view to animate the change to the new heading or `NO` if you want the map to display the new heading immediately.
-*
-* Changing the heading rotates the map without changing the current center coordinate or zoom level. */
+/**
+ Changes the heading of the map and optionally animates the changes.
+
+ @param direction The heading of the map (measured in degrees) relative to true north.
+ @param animated Specify `YES` if you want the map view to animate the change to the new heading or `NO` if you want the map to display the new heading immediately.
+
+ Changing the heading rotates the map without changing the current center coordinate or zoom level.
+ */
- (void)setDirection:(CLLocationDirection)direction animated:(BOOL)animated;
/** Resets the map rotation to a northern heading. */
@@ -200,214 +249,271 @@ IB_DESIGNABLE
/** A camera representing the current viewpoint of the map. */
@property (nonatomic, copy) MGLMapCamera *camera;
-/** Moves the viewpoint to a different location with respect to the map with an optional transition animation.
-* @param camera The new viewpoint.
-* @param animated Specify `YES` if you want the map view to animate the change to the new viewpoint or `NO` if you want the map to display the new viewpoint immediately. */
+/**
+ Moves the viewpoint to a different location with respect to the map with an optional transition animation.
+
+ @param camera The new viewpoint.
+ @param animated Specify `YES` if you want the map view to animate the change to the new viewpoint or `NO` if you want the map to display the new viewpoint immediately.
+ */
- (void)setCamera:(MGLMapCamera *)camera animated:(BOOL)animated;
-/** Moves the viewpoint to a different location with respect to the map with an optional transition duration and timing function.
-* @param camera The new viewpoint.
-* @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to jump to the new viewpoint instantaneously.
-* @param function A timing function used for the animation. Set this parameter to `nil` for a transition that matches most system animations. If the duration is `0`, this parameter is ignored. */
+/**
+ Moves the viewpoint to a different location with respect to the map with an optional transition duration and timing function.
+
+ @param camera The new viewpoint.
+ @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to jump to the new viewpoint instantaneously.
+ @param function A timing function used for the animation. Set this parameter to `nil` for a transition that matches most system animations. If the duration is `0`, this parameter is ignored.
+ */
- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function;
-/** Moves the viewpoint to a different location with respect to the map with an optional transition duration and timing function.
-* @param camera The new viewpoint.
-* @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to jump to the new viewpoint instantaneously.
-* @param function A timing function used for the animation. Set this parameter to `nil` for a transition that matches most system animations. If the duration is `0`, this parameter is ignored.
-* @param completion The block to execute after the animation finishes. */
+/**
+ Moves the viewpoint to a different location with respect to the map with an optional transition duration and timing function.
+
+ @param camera The new viewpoint.
+ @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to jump to the new viewpoint instantaneously.
+ @param function A timing function used for the animation. Set this parameter to `nil` for a transition that matches most system animations. If the duration is `0`, this parameter is ignored.
+ @param completion The block to execute after the animation finishes.
+ */
- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion;
-/** Moves the viewpoint to a different location using a transition animation that evokes powered flight and a default duration based on the length of the flight path.
-*
-* The transition animation seamlessly incorporates zooming and panning to help the user find his or her bearings even after traversing a great distance.
-*
-* @param camera The new viewpoint.
-* @param completion The block to execute after the animation finishes. */
+/**
+ Moves the viewpoint to a different location using a transition animation that evokes powered flight and a default duration based on the length of the flight path.
+
+ The transition animation seamlessly incorporates zooming and panning to help the user find his or her bearings even after traversing a great distance.
+
+ @param camera The new viewpoint.
+ @param completion The block to execute after the animation finishes.
+ */
- (void)flyToCamera:(MGLMapCamera *)camera completionHandler:(nullable void (^)(void))completion;
-/** Moves the viewpoint to a different location using a transition animation that evokes powered flight and an optional transition duration.
-*
-* The transition animation seamlessly incorporates zooming and panning to help the user find his or her bearings even after traversing a great distance.
-*
-* @param camera The new viewpoint.
-* @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to jump to the new viewpoint instantaneously. Specify a negative value to use the default duration, which is based on the length of the flight path.
-* @param completion The block to execute after the animation finishes. */
+/**
+ Moves the viewpoint to a different location using a transition animation that evokes powered flight and an optional transition duration.
+
+ The transition animation seamlessly incorporates zooming and panning to help the user find his or her bearings even after traversing a great distance.
+
+ @param camera The new viewpoint.
+ @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to jump to the new viewpoint instantaneously. Specify a negative value to use the default duration, which is based on the length of the flight path.
+ @param completion The block to execute after the animation finishes.
+ */
- (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion;
-/** Moves the viewpoint to a different location using a transition animation that evokes powered flight and an optional transition duration and peak altitude.
-*
-* The transition animation seamlessly incorporates zooming and panning to help the user find his or her bearings even after traversing a great distance.
-*
-* @param camera The new viewpoint.
-* @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to jump to the new viewpoint instantaneously. Specify a negative value to use the default duration, which is based on the length of the flight path.
-* @param peakAltitude The altitude, measured in meters, at the midpoint of the animation. The value of this parameter is ignored if it is negative or if the animation transition resulting from a similar call to `-setCamera:animated:` would have a midpoint at a higher altitude.
-* @param completion The block to execute after the animation finishes. */
+/**
+ Moves the viewpoint to a different location using a transition animation that evokes powered flight and an optional transition duration and peak altitude.
+
+ The transition animation seamlessly incorporates zooming and panning to help the user find his or her bearings even after traversing a great distance.
+
+ @param camera The new viewpoint.
+ @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to jump to the new viewpoint instantaneously. Specify a negative value to use the default duration, which is based on the length of the flight path.
+ @param peakAltitude The altitude, measured in meters, at the midpoint of the animation. The value of this parameter is ignored if it is negative or if the animation transition resulting from a similar call to `-setCamera:animated:` would have a midpoint at a higher altitude.
+ @param completion The block to execute after the animation finishes.
+ */
- (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration peakAltitude:(CLLocationDistance)peakAltitude completionHandler:(nullable void (^)(void))completion;
-#pragma mark - Converting Map Coordinates
-
-/** @name Converting Map Coordinates */
+#pragma mark Converting Map Coordinates
-/** Converts a point in the specified view’s coordinate system to a map coordinate.
-* @param point The point you want to convert.
-* @param view The view that serves as the reference coordinate system for the `point` parameter.
-* @return The map coordinate at the specified point. */
+/**
+ Converts a point in the specified view’s coordinate system to a map coordinate.
+
+ @param point The point you want to convert.
+ @param view The view that serves as the reference coordinate system for the `point` parameter.
+ @return The map coordinate at the specified point.
+ */
- (CLLocationCoordinate2D)convertPoint:(CGPoint)point toCoordinateFromView:(nullable UIView *)view;
-/** Converts a map coordinate to a point in the specified view.
-* @param coordinate The map coordinate for which you want to find the corresponding point.
-* @param view The view in whose coordinate system you want to locate the specified map coordinate. If this parameter is `nil`, the returned point is specified in the window’s coordinate system. If `view` is not `nil`, it must belong to the same window as the map view.
-* @return The point (in the appropriate view or window coordinate system) corresponding to the specified latitude and longitude value. */
+/**
+ Converts a map coordinate to a point in the specified view.
+
+ @param coordinate The map coordinate for which you want to find the corresponding point.
+ @param view The view in whose coordinate system you want to locate the specified map coordinate. If this parameter is `nil`, the returned point is specified in the window’s coordinate system. If `view` is not `nil`, it must belong to the same window as the map view.
+ @return The point (in the appropriate view or window coordinate system) corresponding to the specified latitude and longitude value.
+ */
- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(nullable UIView *)view;
-/** Returns the distance spanned by one point in the map view’s coordinate system at the given latitude and current zoom level.
-*
-* The distance between points decreases as the latitude approaches the poles. This relationship parallels the relationship between longitudinal coordinates at different latitudes.
-*
-* @param latitude The latitude of the geographic coordinate represented by the point.
-* @return The distance in meters spanned by a single point. */
+/**
+ Returns the distance spanned by one point in the map view's coordinate system at the given latitude and current zoom level.
+
+ The distance between points decreases as the latitude approaches the poles. This relationship parallels the relationship between longitudinal coordinates at different latitudes.
+
+ @param latitude The latitude of the geographic coordinate represented by the point.
+ @return The distance in meters spanned by a single point.
+ */
- (CLLocationDistance)metersPerPointAtLatitude:(CLLocationDegrees)latitude;
-- (CLLocationDistance)metersPerPixelAtLatitude:(CLLocationDegrees)latitude __attribute__((deprecated("Call -metersPerPointAtLatitude: instead.")));
+- (CLLocationDistance)metersPerPixelAtLatitude:(CLLocationDegrees)latitude __attribute__((deprecated("Use -metersPerPointAtLatitude:.")));
-#pragma mark - Styling the Map
-
-/** @name Styling the Map */
+#pragma mark Styling the Map
@property (nonatomic, nullable) NSString *styleID __attribute__((unavailable("Set styleURL to an NSURL of the form <mapbox://styles/STYLE_ID>, where STYLE_ID would have been the value of this property.")));
-/** URLs of the styles bundled with the library.
- @deprecated Call the relevant class method of `MGLStyle` for the URL of a particular default style. */
+/**
+ URLs of the styles bundled with the library.
+
+ @deprecated Call the relevant class method of `MGLStyle` for the URL of a particular default style.
+ */
@property (nonatomic, readonly) NS_ARRAY_OF(NSURL *) *bundledStyleURLs __attribute__((deprecated("Call the relevant class method of MGLStyle for the URL of a particular default style.")));
-/** URL of the style currently displayed in the receiver.
-*
-* The URL may be a full HTTP or HTTPS URL or a Mapbox URL indicating the style’s map ID (`mapbox://styles/<user>/<style>`).
-*
-* To display the default style, set this property to `nil`. */
+/**
+ URL of the style currently displayed in the receiver.
+
+ The URL may be a full HTTP or HTTPS URL or a Mapbox URL indicating the style’s map ID (`mapbox://styles/my_user_name/abcd1234`).
+
+ To display the default style, set this property to `nil`.
+ */
@property (nonatomic, null_resettable) NSURL *styleURL;
/** Currently active style classes, represented as an array of string identifiers. */
@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses;
-/** Returns a Boolean value indicating whether the style class with the given identifier is currently active.
- @param styleClass The style class to query for.
- @return Whether the style class is currently active. */
+/**
+ Returns a Boolean value indicating whether the style class with the given identifier is currently active.
+
+ @param styleClass The style class to query for.
+ @return Whether the style class is currently active.
+ */
- (BOOL)hasStyleClass:(NSString *)styleClass;
-/** Activates the style class with the given identifier.
- @param styleClass The style class to activate. */
+/**
+ Activates the style class with the given identifier.
+
+ @param styleClass The style class to activate.
+ */
- (void)addStyleClass:(NSString *)styleClass;
-/** Deactivates the style class with the given identifier.
- @param styleClass The style class to deactivate. */
+/**
+ Deactivates the style class with the given identifier.
+
+ @param styleClass The style class to deactivate.
+ */
- (void)removeStyleClass:(NSString *)styleClass;
-#pragma mark - Annotating the Map
-
-/** @name Annotating the Map */
+#pragma mark Annotating the Map
-/** The complete list of annotations associated with the receiver. (read-only)
-*
-* The objects in this array must adopt the MGLAnnotation protocol. If no annotations are associated with the map view, the value of this property is `nil`. */
+/**
+ The complete list of annotations associated with the receiver. (read-only)
+
+ The objects in this array must adopt the MGLAnnotation protocol. If no annotations are associated with the map view, the value of this property is `nil`.
+ */
@property (nonatomic, readonly, nullable) NS_ARRAY_OF(id <MGLAnnotation>) *annotations;
-/** Adds the specified annotation to the map view.
-* @param annotation The annotation object to add to the receiver. This object must conform to the MGLAnnotation protocol. The map view retains the specified object. */
+/**
+ Adds the specified annotation to the map view.
+
+ @param annotation The annotation object to add to the receiver. This object must conform to the MGLAnnotation protocol. The map view retains the specified object.
+ */
- (void)addAnnotation:(id <MGLAnnotation>)annotation;
-/** Adds an array of annotation objects to the map view.
-* @param annotations An array of annotation objects. Each object in the array must conform to the MGLAnnotation protocol. The map view retains the individual annotation objects. */
+/**
+ Adds an array of annotation objects to the map view.
+
+ @param annotations An array of annotation objects. Each object in the array must conform to the MGLAnnotation protocol. The map view retains the individual annotation objects.
+ */
- (void)addAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations;
-/** Removes the specified annotation object from the map view.
-*
-* Removing an annotation object disassociates it from the map view entirely, preventing it from being displayed on the map. Thus, you would typically call this method only when you want to hide or delete a given annotation.
-*
-* @param annotation The annotation object to remove. This object must conform to the MGLAnnotation protocol. */
+/**
+ Removes the specified annotation object from the map view.
+
+ Removing an annotation object disassociates it from the map view entirely, preventing it from being displayed on the map. Thus, you would typically call this method only when you want to hide or delete a given annotation.
+
+ @param annotation The annotation object to remove. This object must conform to the MGLAnnotation protocol.
+ */
- (void)removeAnnotation:(id <MGLAnnotation>)annotation;
-/** Removes an array of annotation objects from the map view.
-*
-* Removing annotation objects disassociates them from the map view entirely, preventing them from being displayed on the map. Thus, you would typically call this method only when you want to hide or delete the specified annotations.
-*
-* @param annotations The array of annotations to remove. Objects in the array must conform to the MGLAnnotation protocol. */
+/**
+ Removes an array of annotation objects from the map view.
+
+ Removing annotation objects disassociates them from the map view entirely, preventing them from being displayed on the map. Thus, you would typically call this method only when you want to hide or delete the specified annotations.
+
+ @param annotations The array of annotations to remove. Objects in the array must conform to the MGLAnnotation protocol.
+ */
- (void)removeAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations;
-/** Returns a reusable annotation image object located by its identifier.
-*
-* For performance reasons, you should generally reuse MGLAnnotationImage objects for annotations in your map views. Dequeueing saves time and memory during performance-critical operations such as scrolling.
-*
-* @param identifier A string identifying the annotation image to be reused. This string is the same one you specify when initially returning the annotation image object using the mapView:imageForAnnotation: method.
-* @return An annotation image object with the specified identifier, or `nil` if no such object exists in the reuse queue. */
+/**
+ Returns a reusable annotation image object located by its identifier.
+
+ For performance reasons, you should generally reuse MGLAnnotationImage objects for annotations in your map views. Dequeueing saves time and memory during performance-critical operations such as scrolling.
+
+ @param identifier A string identifying the annotation image to be reused. This string is the same one you specify when initially returning the annotation image object using the mapView:imageForAnnotation: method.
+ @return An annotation image object with the specified identifier, or `nil` if no such object exists in the reuse queue.
+ */
- (nullable MGLAnnotationImage *)dequeueReusableAnnotationImageWithIdentifier:(NSString *)identifier;
-#pragma mark - Managing Annotation Selections
-
-/** @name Managing Annotation Selections */
+#pragma mark Managing Annotation Selections
-/** The annotations that are currently selected.
-*
-* Assigning a new array to this property selects only the first annotation in the array. */
+/**
+ The annotations that are currently selected.
+
+ Assigning a new array to this property selects only the first annotation in the array.
+ */
@property (nonatomic, copy) NS_ARRAY_OF(id <MGLAnnotation>) *selectedAnnotations;
-/** Selects the specified annotation and displays a callout view for it.
-*
-* If the specified annotation is not onscreen, this method has no effect.
-*
-* @param annotation The annotation object to select.
-* @param animated If `YES`, the callout view is animated into position. */
+/**
+ Selects the specified annotation and displays a callout view for it.
+
+ If the specified annotation is not onscreen, this method has no effect.
+
+ @param annotation The annotation object to select.
+ @param animated If `YES`, the callout view is animated into position.
+ */
- (void)selectAnnotation:(id <MGLAnnotation>)annotation animated:(BOOL)animated;
-/** Deselects the specified annotation and hides its callout view.
-* @param annotation The annotation object to deselect.
-* @param animated If `YES`, the callout view is animated offscreen. */
+/**
+ Deselects the specified annotation and hides its callout view.
+
+ @param annotation The annotation object to deselect.
+ @param animated If `YES`, the callout view is animated offscreen.
+ */
- (void)deselectAnnotation:(id <MGLAnnotation>)annotation animated:(BOOL)animated;
-#pragma mark - Adding Overlays
+#pragma mark Adding Overlays
-/** @name Adding Overlays */
-
-/** Adds a single overlay object to the map.
-*
-* To remove an overlay from a map, use the removeOverlay: method.
-* @param overlay The overlay object to add. This object must conform to the MGLOverlay protocol. */
+/**
+ Adds a single overlay object to the map.
+
+ To remove an overlay from a map, use the `-removeOverlay:` method.
+
+ @param overlay The overlay object to add. This object must conform to the MGLOverlay protocol. */
- (void)addOverlay:(id <MGLOverlay>)overlay;
-/** Adds an array of overlay objects to the map.
-*
-* To remove multiple overlays from a map, use the removeOverlays: method.
-* @param overlays An array of objects, each of which must conform to the MGLOverlay protocol. */
+/**
+ Adds an array of overlay objects to the map.
+
+ To remove multiple overlays from a map, use the `-removeOverlays:` method.
+
+ @param overlays An array of objects, each of which must conform to the MGLOverlay protocol.
+ */
- (void)addOverlays:(NS_ARRAY_OF(id <MGLOverlay>) *)overlays;
-#pragma mark - Removing Overlays
-
-/** @name Removing Overlays */
+#pragma mark Removing Overlays
-/** Removes a single overlay object from the map.
-*
-* If the specified overlay is not currently associated with the map view, this method does nothing.
-* @param overlay The overlay object to remove. */
+/**
+ Removes a single overlay object from the map.
+
+ If the specified overlay is not currently associated with the map view, this method does nothing.
+
+ @param overlay The overlay object to remove.
+ */
- (void)removeOverlay:(id <MGLOverlay>)overlay;
-/** Removes one or more overlay objects from the map.
-*
-* If a given overlay object is not associated with the map view, it is ignored.
-* @param overlays An array of objects, each of which conforms to the MGLOverlay protocol. */
+/**
+ Removes one or more overlay objects from the map.
+
+ If a given overlay object is not associated with the map view, it is ignored.
+
+ @param overlays An array of objects, each of which conforms to the MGLOverlay protocol.
+ */
- (void)removeOverlays:(NS_ARRAY_OF(id <MGLOverlay>) *)overlays;
-#pragma mark - Displaying the User's Location
-
-/** @name Displaying the User's Location */
-
-/** A Boolean value indicating whether the map may display the user location.
-*
-* This property does not indicate whether the user’s position is actually visible on the map, only whether the map view is allowed to display it. To determine whether the user’s position is visible, use the userLocationVisible property. The default value of this property is `NO`.
-*
-* Setting this property to `YES` causes the map view to use the Core Location framework to find the current location. As long as this property is `YES`, the map view continues to track the user’s location and update it periodically.
-*
-* On iOS 8 and above, your app must specify a value for `NSLocationWhenInUseUsageDescription` or `NSLocationAlwaysUsageDescription` in its `Info.plist` to satisfy the requirements of the underlying Core Location framework when enabling this property. */
+#pragma mark Displaying the User's Location
+
+/**
+ A Boolean value indicating whether the map may display the user location.
+
+ This property does not indicate whether the user’s position is actually visible on the map, only whether the map view is allowed to display it. To determine whether the user’s position is visible, use the userLocationVisible property. The default value of this property is `NO`.
+
+ Setting this property to `YES` causes the map view to use the Core Location framework to find the current location. As long as this property is `YES`, the map view continues to track the user’s location and update it periodically.
+
+ On iOS 8 and above, your app must specify a value for `NSLocationWhenInUseUsageDescription` or `NSLocationAlwaysUsageDescription` in its `Info.plist` to satisfy the requirements of the underlying Core Location framework when enabling this property.
+ */
@property (nonatomic, assign) BOOL showsUserLocation;
/** A Boolean value indicating whether the device’s current location is visible in the map view. (read-only) */
@@ -422,13 +528,13 @@ IB_DESIGNABLE
/** Whether the map view should display a heading calibration alert when necessary. The default value is `YES`. */
@property (nonatomic, assign) BOOL displayHeadingCalibration;
-#pragma mark - Debugging
-
-/** @name Debugging */
+#pragma mark Debugging
-/** A Boolean value that determines whether map debugging information is shown.
-*
-* The default value of this property is `NO`. */
+/**
+ A Boolean value that determines whether map debugging information is shown.
+
+ The default value of this property is `NO`.
+ */
@property (nonatomic, getter=isDebugActive) BOOL debugActive;
/** Cycle map debug options. */
@@ -444,49 +550,60 @@ IB_DESIGNABLE
#pragma mark - MGLMapViewDelegate
-/** The MGLMapViewDelegate protocol defines a set of optional methods that you can use to receive map-related update messages. Because many map operations require the MGLMapView class to load data asynchronously, the map view calls these methods to notify your application when specific operations complete. The map view also uses these methods to request annotation marker symbology and to manage interactions with those markers. */
+/** The MGLMapViewDelegate protocol defines a set of optional methods that you can use to receive map-related update messages. Because many map operations require the `MGLMapView` class to load data asynchronously, the map view calls these methods to notify your application when specific operations complete. The map view also uses these methods to request annotation marker symbology and to manage interactions with those markers. */
@protocol MGLMapViewDelegate <NSObject>
@optional
-#pragma mark - Responding to Map Position Changes
+#pragma mark Responding to Map Position Changes
-/** @name Responding to Map Position Changes */
-
-/** Tells the delegate that the region displayed by the map view is about to change.
- *
- * This method is called whenever the currently displayed map region will start changing.
- * @param mapView The map view whose visible region will change.
- * @param animated Whether the change will cause an animated effect on the map. */
+/**
+ Tells the delegate that the region displayed by the map view is about to change.
+
+ This method is called whenever the currently displayed map region will start changing.
+
+ @param mapView The map view whose visible region will change.
+ @param animated Whether the change will cause an animated effect on the map.
+ */
- (void)mapView:(MGLMapView *)mapView regionWillChangeAnimated:(BOOL)animated;
-/** Tells the delegate that the region displayed by the map view is changing.
- *
- * This method is called whenever the currently displayed map region changes. During movement, this method may be called many times to report updates to the map position. Therefore, your implementation of this method should be as lightweight as possible to avoid affecting performance.
- * @param mapView The map view whose visible region is changing. */
+/**
+ Tells the delegate that the region displayed by the map view is changing.
+
+ This method is called whenever the currently displayed map region changes. During movement, this method may be called many times to report updates to the map position. Therefore, your implementation of this method should be as lightweight as possible to avoid affecting performance.
+
+ @param mapView The map view whose visible region is changing.
+ */
- (void)mapViewRegionIsChanging:(MGLMapView *)mapView;
-/** Tells the delegate that the region displayed by the map view just changed.
- *
- * This method is called whenever the currently displayed map region has finished changing.
- * @param mapView The map view whose visible region changed.
- * @param animated Whether the change caused an animated effect on the map. */
+/**
+ Tells the delegate that the region displayed by the map view just changed.
+
+ This method is called whenever the currently displayed map region has finished changing.
+
+ @param mapView The map view whose visible region changed.
+ @param animated Whether the change caused an animated effect on the map.
+ */
- (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated;
-#pragma mark - Loading the Map
-
-/** @name Loading the Map */
+#pragma mark Loading the Map
-/** Tells the delegate that the map view will begin to load.
- *
- * This method is called whenever the map view starts loading, including when a new style has been set and the map must reload.
- * @param mapView The map view that is starting to load. */
+/**
+ Tells the delegate that the map view will begin to load.
+
+ This method is called whenever the map view starts loading, including when a new style has been set and the map must reload.
+
+ @param mapView The map view that is starting to load.
+ */
- (void)mapViewWillStartLoadingMap:(MGLMapView *)mapView;
-/** Tells the delegate that the map view has finished loading.
- *
- * This method is called whenever the map view finishes loading, either after the initial load or after a style change has forced a reload.
- * @param mapView The map view that has finished loading. */
+/**
+ Tells the delegate that the map view has finished loading.
+
+ This method is called whenever the map view finishes loading, either after the initial load or after a style change has forced a reload.
+
+ @param mapView The map view that has finished loading.
+ */
- (void)mapViewDidFinishLoadingMap:(MGLMapView *)mapView;
// TODO
@@ -504,155 +621,188 @@ IB_DESIGNABLE
// TODO
- (void)mapViewDidFinishRenderingFrame:(MGLMapView *)mapView fullyRendered:(BOOL)fullyRendered;
-#pragma mark - Tracking User Location
+#pragma mark Tracking User Location
-/** @name Tracking User Location */
-
-/** Tells the delegate that the map view will begin tracking the user’s location.
- *
- * This method is called when the value of the showsUserLocation property changes to `YES`.
- *
- * @param mapView The map view that is tracking the user’s location. */
+/**
+ Tells the delegate that the map view will begin tracking the user’s location.
+
+ This method is called when the value of the `showsUserLocation` property changes to `YES`.
+
+ @param mapView The map view that is tracking the user’s location.
+ */
- (void)mapViewWillStartLocatingUser:(MGLMapView *)mapView;
-/** Tells the delegate that the map view has stopped tracking the user’s location.
- *
- * This method is called when the value of the showsUserLocation property changes to `NO`.
- *
- * @param mapView The map view that is tracking the user’s location. */
+/**
+ Tells the delegate that the map view has stopped tracking the user’s location.
+
+ This method is called when the value of the `showsUserLocation` property changes to `NO`.
+
+ @param mapView The map view that is tracking the user’s location.
+ */
- (void)mapViewDidStopLocatingUser:(MGLMapView *)mapView;
-/** Tells the delegate that the location of the user was updated.
- *
- * While the showsUserLocation property is set to `YES`, this method is called whenever a new location update is received by the map view. This method is also called if the map view’s user tracking mode is set to MGLUserTrackingModeFollowWithHeading and the heading changes, or if it is set to MGLUserTrackingModeFollowWithCourse and the course changes.
- *
- * This method is not called if the application is currently running in the background. If you want to receive location updates while running in the background, you must use the Core Location framework.
- *
- * @param mapView The map view that is tracking the user’s location.
- * @param userLocation The location object representing the user’s latest location. This property may be `nil`. */
+/**
+ Tells the delegate that the location of the user was updated.
+
+ While the `showsUserLocation` property is set to `YES`, this method is called whenever a new location update is received by the map view. This method is also called if the map view’s user tracking mode is set to `MGLUserTrackingModeFollowWithHeading` and the heading changes, or if it is set to `MGLUserTrackingModeFollowWithCourse` and the course changes.
+
+ This method is not called if the application is currently running in the background. If you want to receive location updates while running in the background, you must use the Core Location framework.
+
+ @param mapView The map view that is tracking the user’s location.
+ @param userLocation The location object representing the user’s latest location. This property may be `nil`.
+ */
- (void)mapView:(MGLMapView *)mapView didUpdateUserLocation:(nullable MGLUserLocation *)userLocation;
-/** Tells the delegate that an attempt to locate the user’s position failed.
- * @param mapView The map view that is tracking the user’s location.
- * @param error An error object containing the reason why location tracking failed. */
+/**
+ Tells the delegate that an attempt to locate the user’s position failed.
+
+ @param mapView The map view that is tracking the user’s location.
+ @param error An error object containing the reason why location tracking failed.
+ */
- (void)mapView:(MGLMapView *)mapView didFailToLocateUserWithError:(NSError *)error;
-/** Tells the delegate that the map view’s user tracking mode has changed.
- *
- * This method is called after the map view asynchronously changes to reflect the new user tracking mode, for example by beginning to zoom or rotate.
- *
- * @param mapView The map view that changed its tracking mode.
- * @param mode The new tracking mode.
- * @param animated Whether the change caused an animated effect on the map. */
+/**
+ Tells the delegate that the map view’s user tracking mode has changed.
+
+ This method is called after the map view asynchronously changes to reflect the new user tracking mode, for example by beginning to zoom or rotate.
+
+ @param mapView The map view that changed its tracking mode.
+ @param mode The new tracking mode.
+ @param animated Whether the change caused an animated effect on the map.
+ */
- (void)mapView:(MGLMapView *)mapView didChangeUserTrackingMode:(MGLUserTrackingMode)mode animated:(BOOL)animated;
-#pragma mark - Managing the Display of Annotations
-
-/** @name Managing the Display of Annotations */
+#pragma mark Managing the Display of Annotations
- (nullable NSString *)mapView:(MGLMapView *)mapView symbolNameForAnnotation:(id <MGLAnnotation>)annotation __attribute__((unavailable("Use -mapView:imageForAnnotation:.")));
-/** Returns an image object to use for the marker for the specified point annotation object.
-* @param mapView The map view that requested the annotation image.
-* @param annotation The object representing the annotation that is about to be displayed.
-* @return The image object to display for the specified annotation or `nil` if you want to display the default marker image. */
+/**
+ Returns an image object to use for the marker for the specified point annotation object.
+
+ @param mapView The map view that requested the annotation image.
+ @param annotation The object representing the annotation that is about to be displayed.
+ @return The image object to display for the specified annotation or `nil` if you want to display the default marker image.
+ */
- (nullable MGLAnnotationImage *)mapView:(MGLMapView *)mapView imageForAnnotation:(id <MGLAnnotation>)annotation;
-/** Returns the alpha value to use when rendering a shape annotation. Defaults to `1.0`.
-* @param mapView The map view rendering the shape annotation.
-* @param annotation The annotation being rendered.
-* @return An alpha value between `0` and `1.0`. */
+/**
+ Returns the alpha value to use when rendering a shape annotation. Defaults to `1.0`.
+
+ @param mapView The map view rendering the shape annotation.
+ @param annotation The annotation being rendered.
+ @return An alpha value between `0` and `1.0`.
+ */
- (CGFloat)mapView:(MGLMapView *)mapView alphaForShapeAnnotation:(MGLShape *)annotation;
-/** Returns the stroke color to use when rendering a shape annotation. Defaults to black.
-* @param mapView The map view rendering the shape annotation.
-* @param annotation The annotation being rendered.
-* @return A color to use for the shape outline. */
+/**
+ Returns the stroke color to use when rendering a shape annotation. Defaults to black.
+
+ @param mapView The map view rendering the shape annotation.
+ @param annotation The annotation being rendered.
+ @return A color to use for the shape outline.
+ */
- (UIColor *)mapView:(MGLMapView *)mapView strokeColorForShapeAnnotation:(MGLShape *)annotation;
-/** Returns the fill color to use when rendering a polygon annotation. Defaults to blue.
-* @param mapView The map view rendering the polygon annotation.
-* @param annotation The annotation being rendered.
-* @return A color to use for the polygon interior. */
+/**
+ Returns the fill color to use when rendering a polygon annotation. Defaults to blue.
+
+ @param mapView The map view rendering the polygon annotation.
+ @param annotation The annotation being rendered.
+ @return A color to use for the polygon interior.
+ */
- (UIColor *)mapView:(MGLMapView *)mapView fillColorForPolygonAnnotation:(MGLPolygon *)annotation;
-/** Returns the line width to use when rendering a polyline annotation. Defaults to `3.0`.
-* @param mapView The map view rendering the polygon annotation.
-* @param annotation The annotation being rendered.
-* @return A line width for the polyline. */
+/**
+ Returns the line width to use when rendering a polyline annotation. Defaults to `3.0`.
+
+ @param mapView The map view rendering the polygon annotation.
+ @param annotation The annotation being rendered.
+ @return A line width for the polyline.
+ */
- (CGFloat)mapView:(MGLMapView *)mapView lineWidthForPolylineAnnotation:(MGLPolyline *)annotation;
-/** Returns a Boolean value indicating whether the annotation is able to display extra information in a callout bubble.
-*
-* If the value returned is `YES`, a standard callout bubble is shown when the user taps a selected annotation. The callout uses the title and subtitle text from the associated annotation object. If there is no title text, though, the annotation will not show a callout. The callout also displays any custom callout views returned by the delegate for the left and right callout accessory views.
-*
-* If the value returned is `NO`, the value of the title and subtitle strings are ignored.
-*
-* @param mapView The map view that requested the annotation callout ability.
-* @param annotation The object representing the annotation.
-* @return A Boolean indicating whether the annotation should show a callout. */
+/**
+ Returns a Boolean value indicating whether the annotation is able to display extra information in a callout bubble.
+
+ If the value returned is `YES`, a standard callout bubble is shown when the user taps a selected annotation. The callout uses the title and subtitle text from the associated annotation object. If there is no title text, though, the annotation will not show a callout. The callout also displays any custom callout views returned by the delegate for the left and right callout accessory views.
+
+ If the value returned is `NO`, the value of the title and subtitle strings are ignored.
+
+ @param mapView The map view that requested the annotation callout ability.
+ @param annotation The object representing the annotation.
+ @return A Boolean indicating whether the annotation should show a callout.
+ */
- (BOOL)mapView:(MGLMapView *)mapView annotationCanShowCallout:(id <MGLAnnotation>)annotation;
-/** Return the view to display on the left side of the standard callout bubble.
-*
-* The default value is treated as if `nil`. The left callout view is typically used to display information about the annotation or to link to custom information provided by your application.
-*
-* If the view you specify is also a descendant of the `UIControl` class, you can use the map view’s delegate to receive notifications when your control is tapped. If it does not descend from `UIControl`, your view is responsible for handling any touch events within its bounds.
-*
-* @param mapView The map view presenting the annotation callout.
-* @param annotation The object representing the annotation with the callout.
-* @return The accessory view to display. */
+/**
+ Return the view to display on the left side of the standard callout bubble.
+
+ The default value is treated as if `nil`. The left callout view is typically used to display information about the annotation or to link to custom information provided by your application.
+
+ If the view you specify is also a descendant of the `UIControl` class, you can use the map view’s delegate to receive notifications when your control is tapped. If it does not descend from `UIControl`, your view is responsible for handling any touch events within its bounds.
+
+ @param mapView The map view presenting the annotation callout.
+ @param annotation The object representing the annotation with the callout.
+ @return The accessory view to display.
+ */
- (nullable UIView *)mapView:(MGLMapView *)mapView leftCalloutAccessoryViewForAnnotation:(id <MGLAnnotation>)annotation;
-/** Return the view to display on the right side of the standard callout bubble.
-*
-* The default value is treated is if `nil`. The right callout view is typically used to link to more detailed information about the annotation. A common view to specify for this property is `UIButton` object whose type is set to `UIButtonTypeDetailDisclosure`.
-*
-* If the view you specify is also a descendant of the `UIControl` class, you can use the map view’s delegate to receive notifications when your control is tapped. If it does not descend from `UIControl`, your view is responsible for handling any touch events within its bounds.
-*
-* @param mapView The map view presenting the annotation callout.
-* @param annotation The object representing the annotation with the callout.
-* @return The accessory view to display. */
+/**
+ Return the view to display on the right side of the standard callout bubble.
+
+ The default value is treated is if `nil`. The right callout view is typically used to link to more detailed information about the annotation. A common view to specify for this property is `UIButton` object whose type is set to `UIButtonTypeDetailDisclosure`.
+
+ If the view you specify is also a descendant of the `UIControl` class, you can use the map view’s delegate to receive notifications when your control is tapped. If it does not descend from `UIControl`, your view is responsible for handling any touch events within its bounds.
+
+ @param mapView The map view presenting the annotation callout.
+ @param annotation The object representing the annotation with the callout.
+ @return The accessory view to display.
+ */
- (nullable UIView *)mapView:(MGLMapView *)mapView rightCalloutAccessoryViewForAnnotation:(id <MGLAnnotation>)annotation;
-#pragma mark - Managing Annotations
-
-/** @name Managing Annotations */
-
-/** Tells the delegate that the user tapped one of the annotation's accessory buttons.
-*
-* Accessory views contain custom content and are positioned on either side of the annotation title text. If a view you specify is a descendant of the `UIControl` class, the map view calls this method as a convenience whenever the user taps your view. You can use this method to respond to taps and perform any actions associated with that control. For example, if your control displayed additional information about the annotation, you could use this method to present a modal panel with that information.
-*
-* If your custom accessory views are not descendants of the `UIControl` class, the map view does not call this method.
-*
-* @param mapView The map view containing the specified annotation.
-* @param annotation The annotation whose button was tapped.
-* @param control The control that was tapped. */
+#pragma mark Managing Annotations
+
+/**
+ Tells the delegate that the user tapped one of the annotation's accessory buttons.
+
+ Accessory views contain custom content and are positioned on either side of the annotation title text. If a view you specify is a descendant of the `UIControl` class, the map view calls this method as a convenience whenever the user taps your view. You can use this method to respond to taps and perform any actions associated with that control. For example, if your control displayed additional information about the annotation, you could use this method to present a modal panel with that information.
+
+ If your custom accessory views are not descendants of the `UIControl` class, the map view does not call this method.
+
+ @param mapView The map view containing the specified annotation.
+ @param annotation The annotation whose button was tapped.
+ @param control The control that was tapped.
+ */
- (void)mapView:(MGLMapView *)mapView annotation:(id <MGLAnnotation>)annotation calloutAccessoryControlTapped:(UIControl *)control;
-/** Tells the delegate that the user tapped on an annotation's callout view.
-* @param mapView The map view containing the specified annotation.
-* @param annotation The annotation whose callout was tapped.*/
+/**
+ Tells the delegate that the user tapped on an annotation's callout view.
+
+ @param mapView The map view containing the specified annotation.
+ @param annotation The annotation whose callout was tapped.
+ */
- (void)mapView:(MGLMapView *)mapView tapOnCalloutForAnnotation:(id <MGLAnnotation>)annotation;
-#pragma mark - Selecting Annotations
-
-/** @name Selecting Annotations */
+#pragma mark Selecting Annotations
-/** Tells the delegate that one of its annotations was selected.
-*
-* You can use this method to track changes in the selection state of annotations.
-*
-* @param mapView The map view containing the annotation.
-* @param annotation The annotation that was selected. */
+/**
+ Tells the delegate that one of its annotations was selected.
+
+ You can use this method to track changes in the selection state of annotations.
+
+ @param mapView The map view containing the annotation.
+ @param annotation The annotation that was selected.
+ */
- (void)mapView:(MGLMapView *)mapView didSelectAnnotation:(id <MGLAnnotation>)annotation;
-/** Tells the delegate that one of its annotations was deselected.
-*
-* You can use this method to track changes in the selection state of annotations.
-*
-* @param mapView The map view containing the annotation.
-* @param annotation The annotation that was deselected. */
+/**
+ Tells the delegate that one of its annotations was deselected.
+
+ You can use this method to track changes in the selection state of annotations.
+
+ @param mapView The map view containing the annotation.
+ @param annotation The annotation that was deselected.
+ */
- (void)mapView:(MGLMapView *)mapView didDeselectAnnotation:(id <MGLAnnotation>)annotation;
@end
diff --git a/include/mbgl/ios/MGLUserLocation.h b/include/mbgl/ios/MGLUserLocation.h
index a681ac5932..6160413510 100644
--- a/include/mbgl/ios/MGLUserLocation.h
+++ b/include/mbgl/ios/MGLUserLocation.h
@@ -10,22 +10,26 @@ NS_ASSUME_NONNULL_BEGIN
/** The MGLUserLocation class defines a specific type of annotation that identifies the user’s current location. You do not create instances of this class directly. Instead, you retrieve an existing MGLUserLocation object from the userLocation property of the map view displayed in your application. */
@interface MGLUserLocation : NSObject <MGLAnnotation>
-/** @name Determining the User’s Position */
+#pragma mark Determining the User’s Position
-/** The current location of the device. (read-only)
-*
-* This property contains `nil` if the map view is not currently showing the user location or if the user’s location has not yet been determined. */
+/**
+ The current location of the device. (read-only)
+
+ This property contains `nil` if the map view is not currently showing the user location or if the user’s location has not yet been determined.
+ */
@property (nonatomic, readonly, nullable) CLLocation *location;
/** A Boolean value indicating whether the user’s location is currently being updated. (read-only) */
@property (nonatomic, readonly, getter=isUpdating) BOOL updating;
-/** The heading of the user location. (read-only)
-*
-* This property is `nil` if the user location tracking mode is not `MGLUserTrackingModeFollowWithHeading`. */
+/**
+ The heading of the user location. (read-only)
+
+ This property is `nil` if the user location tracking mode is not `MGLUserTrackingModeFollowWithHeading`.
+ */
@property (nonatomic, readonly, nullable) CLHeading *heading;
-/** @name Accessing the User Annotation Text */
+#pragma mark Accessing the User Annotation Text
/** The title to display for the user location annotation. */
@property (nonatomic, copy) NSString *title;
diff --git a/platform/ios/INSTALL.md b/platform/ios/INSTALL.md
index f3afaea822..2c36b5953c 100644
--- a/platform/ios/INSTALL.md
+++ b/platform/ios/INSTALL.md
@@ -14,13 +14,10 @@ The Mapbox iOS SDK and iosapp demo application build against the iOS 7.0 SDK. Th
1. [Install core dependencies](../../INSTALL.md).
-1. Install [appledoc](http://appledoc.gentlebytes.com/appledoc/) for API docs generation.
+1. Install [jazzy](https://github.com/realm/jazzy) for generating API documentation:
```
- curl -L -o appledoc.zip https://github.com/tomaz/appledoc/releases/download/v2.2-963/appledoc.zip
- unzip appledoc.zip
- cp appledoc /usr/local/bin
- cp -Rf Templates/ ~/.appledoc
+ [sudo] gem install jazzy
```
1. Run `make ipackage`. The packaging script will produce the statically-linked `libMapbox.a`, `Mapbox.bundle` for resources, a `Headers` folder, and a `Docs` folder with HTML API documentation.
diff --git a/platform/ios/bitrise.yml b/platform/ios/bitrise.yml
index e725efb201..25860485a4 100644
--- a/platform/ios/bitrise.yml
+++ b/platform/ios/bitrise.yml
@@ -34,8 +34,7 @@ workflows:
brew install pkgconfig
brew install automake
- brew install homebrew/versions/appledoc22
- brew link --force appledoc22
+ gem install jazzy
- script:
title: Run make ipackage-sim
run_if: '{{enveq "SKIPCI" "false"}}'
diff --git a/platform/ios/scripts/install.sh b/platform/ios/scripts/install.sh
index 23000e160b..437193b1f2 100755
--- a/platform/ios/scripts/install.sh
+++ b/platform/ios/scripts/install.sh
@@ -14,10 +14,7 @@ brew install git
mapbox_time "install_awscli" \
brew install awscli
-mapbox_time "install_appledoc" \
-wget https://github.com/tomaz/appledoc/releases/download/v2.2-963/appledoc.zip && \
-tar xvzf appledoc.zip && \
-cp appledoc /usr/local/bin && \
-cp -Rf Templates/ ~/.appledoc
+mapbox_time "install_jazzy" \
+gem install jazzy
mkdir -p ${KIF_SCREENSHOTS}
diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh
index f1a67bb8f2..b7de1830a5 100755
--- a/platform/ios/scripts/package.sh
+++ b/platform/ios/scripts/package.sh
@@ -6,7 +6,6 @@ set -u
NAME=Mapbox
OUTPUT=build/ios/pkg
-IOS_SDK_VERSION=`xcrun --sdk iphoneos --show-sdk-version`
LIBUV_VERSION=1.7.5
ENABLE_BITCODE=YES
@@ -29,6 +28,12 @@ else # e.g. "make ipackage-strip"
GCC_GENERATE_DEBUGGING_SYMBOLS="NO"
fi
+SDK=iphonesimulator
+if [[ ${BUILD_FOR_DEVICE} == true ]]; then
+ SDK=iphoneos
+fi
+IOS_SDK_VERSION=`xcrun --sdk ${SDK} --show-sdk-version`
+
function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
function finish { >&2 echo -en "\033[0m"; }
trap finish EXIT
@@ -116,9 +121,13 @@ mkdir -p "${OUTPUT}/static/${NAME}.bundle"
cp -pv platform/ios/resources/* "${OUTPUT}/static/${NAME}.bundle"
step "Creating API Docs..."
-if [ -z `which appledoc` ]; then
- echo "Unable to find appledoc. See https://github.com/mapbox/mapbox-gl-native/blob/master/docs/BUILD_IOS_OSX.md"
- exit 1
+if [ -z `which jazzy` ]; then
+ step "Installing jazzy..."
+ gem install jazzy
+ if [ -z `which jazzy` ]; then
+ echo "Unable to install jazzy. See https://github.com/mapbox/mapbox-gl-native/blob/master/docs/BUILD_IOS_OSX.md"
+ exit 1
+ fi
fi
DOCS_OUTPUT="${OUTPUT}/static/Docs"
DOCS_VERSION=$( git tag | grep ^ios | sed 's/^ios-//' | sort -r | grep -v '\-rc.' | grep -v '\-pre.' | sed -n '1p' | sed 's/^v//' )
@@ -129,24 +138,14 @@ cat ios/docs/pod-README.md > ${README}
echo >> ${README}
echo -n "#" >> ${README}
cat CHANGELOG.md | sed -n "/^## iOS ${DOCS_VERSION}/,/^##/p" | sed '$d' >> ${README}
-# Copy headers to a temporary location where we can substitute macros that appledoc doesn't understand.
-cp -r "${OUTPUT}/static/Headers" /tmp/mbgl
-perl \
- -pi \
- -e 's/NS_(?:(MUTABLE)_)?(ARRAY|SET|DICTIONARY)_OF\(\s*(.+?)\s*\)/NS\L\u$1\u$2\E <$3>/g' \
- /tmp/mbgl/Headers/*.h
-perl \
- -i -p0 \
- -e 's/^#if\s+!\s*TARGET_OS_IPHONE\s*(?:&&[^\n]+)?\n.+?\n#endif//gms' \
- /tmp/mbgl/Headers/*.h
-appledoc \
- --output ${DOCS_OUTPUT} \
- --project-name "Mapbox iOS SDK ${DOCS_VERSION}" \
- --project-company Mapbox \
- --create-html \
- --no-create-docset \
- --no-install-docset \
- --company-id com.mapbox \
- --index-desc ${README} \
- /tmp/mbgl/Headers
-cp ${README} "${OUTPUT}/static"
+
+jazzy \
+ --sdk ${SDK} \
+ --github-file-prefix https://github.com/mapbox/mapbox-gl-native/tree/${HASH} \
+ --module-version ${DOCS_VERSION} \
+ --readme ${README} \
+ --root-url https://www.mapbox.com/ios-sdk/api/${DOCS_VERSION}/ \
+ --output ${DOCS_OUTPUT}
+# https://github.com/realm/jazzy/issues/411
+find ${DOCS_OUTPUT} -name *.html -exec \
+ perl -pi -e 's/Mapbox\s+(Docs|Reference)/Mapbox iOS SDK $1/' {} \;