Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Generate iOS API documentation using jazzy #3203

Merged
merged 3 commits into from
Jan 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 17 additions & 11 deletions include/mbgl/darwin/MGLAnnotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 11 additions & 7 deletions include/mbgl/darwin/MGLGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
15 changes: 15 additions & 0 deletions include/mbgl/darwin/MGLMapCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions include/mbgl/darwin/MGLMultiPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 25 additions & 16 deletions include/mbgl/darwin/MGLOverlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions include/mbgl/darwin/MGLPolygon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
11 changes: 7 additions & 4 deletions include/mbgl/darwin/MGLPolyline.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
42 changes: 30 additions & 12 deletions include/mbgl/darwin/MGLStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions include/mbgl/darwin/MGLTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Loading