Fix a bunch of internal links in iOS documentation (#2738)

This commit is contained in:
Bart Louwers
2024-08-20 17:30:22 +02:00
committed by GitHub
parent fceaa18caf
commit d544da140b
84 changed files with 873 additions and 1016 deletions

View File

@@ -5,8 +5,8 @@
NS_ASSUME_NONNULL_BEGIN
/**
The `MLNAnnotationImage` class is responsible for presenting point-based
annotations visually on an `MLNMapView` instance. Annotation image objects pair
The ``MLNAnnotationImage`` class is responsible for presenting point-based
annotations visually on an ``MLNMapView`` instance. Annotation image objects pair
`NSImage` objects with annotation-related metadata. They may be recycled later
and put into a reuse queue that is maintained by the map view.
*/

View File

@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
MLN_EXPORT
@interface MLNAttributionButton : NSButton
/// Returns an `MLNAttributionButton` instance with the given info.
/// Returns an ``MLNAttributionButton`` instance with the given info.
- (instancetype)initWithAttributionInfo:(MLNAttributionInfo *)info;
/// The URL to open and display as a tooltip.

View File

@@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
An interactive, customizable map view with an interface similar to the one
provided by Apple’s MapKit.
Using `MLNMapView`, you can embed the map inside a view, allow users to
Using ``MLNMapView``, you can embed the map inside a view, allow users to
manipulate it with standard gestures, animate the map between different
viewpoints, and present information in the form of annotations and overlays.
@@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
<a href="https://www.mapbox.com/studio/">Mapbox Studio</a> and hosted on
mapbox.com.
A collection of Mapbox-hosted styles is available through the `MLNStyle` class.
A collection of Mapbox-hosted styles is available through the ``MLNStyle`` class.
These basic styles use
<a href="https://www.mapbox.com/developers/vector-tiles/mapbox-streets">Mapbox Streets</a>
or <a href="https://www.mapbox.com/satellite/">Mapbox Satellite</a> data
@@ -47,12 +47,12 @@ NS_ASSUME_NONNULL_BEGIN
your Mapbox account. They also deter other developers from using your styles
without your permission.
Adding your own gesture recognizer to `MLNMapView` will block the corresponding
gesture recognizer built into `MLNMapView`. To avoid conflicts, define which
Adding your own gesture recognizer to ``MLNMapView`` will block the corresponding
gesture recognizer built into ``MLNMapView``. To avoid conflicts, define which
gesture recognizer takes precedence. For example, you can subclass
`NSClickGestureRecognizer` and override `-[NSGestureRecognizer
shouldRequireFailureOfGestureRecognizer:]`, so that your subclass will be invoked only if the
default `MLNMapView` click gesture recognizer fails:
default ``MLNMapView`` click gesture recognizer fails:
```swift
class MapClickGestureRecognizer: NSClickGestureRecognizer {
@@ -113,16 +113,9 @@ MLN_EXPORT IB_DESIGNABLE @interface MLNMapView : NSView<MLNStylable>
If the style is loading, this property is set to `nil` until the style finishes
loading. If the style has failed to load, this property is set to `nil`.
Because the style loads asynchronously, you should manipulate it in the
`-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or
`-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` method. It is not possible
``MLNMapViewDelegate/mapView:didFinishLoadingStyle:`` or
``MLNMapViewDelegate/mapViewDidFinishLoadingMap:`` method. It is not possible
to manipulate the style before it has finished loading.
@note The default styles provided by Mapbox contain sources and layers with
identifiers that will change over time. Applications that use APIs that
manipulate a style's sources and layers must first set the style URL to an
explicitly versioned style using a convenience method like
`+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`.
*/
@property (nonatomic, readonly, nullable) MLNStyle *style;
@@ -787,7 +780,7 @@ around the returned camera object if it were set as the receiver’s camera.
/**
The complete list of annotations associated with the receiver. (read-only)
The objects in this array must adopt the `MLNAnnotation` protocol. If no
The objects in this array must adopt the ``MLNAnnotation`` protocol. If no
annotations are associated with the map view, the value of this property is
`nil`.
*/
@@ -796,14 +789,14 @@ around the returned camera object if it were set as the receiver’s camera.
/**
Adds an annotation to the map view.
@note `MLNMultiPolyline`, `MLNMultiPolygon`, and `MLNShapeCollection` objects
cannot be added to the map view at this time. Nor can `MLNMultiPoint`
objects that are not instances of `MLNPolyline` or `MLNPolygon`. Any
@note ``MLNMultiPolyline``, ``MLNMultiPolyline``, and ``MLNMultiPolyline`` objects
cannot be added to the map view at this time. Nor can ``MLNMultiPoint``
objects that are not instances of ``MLNPolyline`` or ``MLNPolyline``. Any
multipoint, multipolyline, multipolygon, or shape collection object that is
specified is silently ignored.
@param annotation The annotation object to add to the receiver. This object
must conform to the `MLNAnnotation` protocol. The map view retains the
must conform to the ``MLNAnnotation`` protocol. The map view retains the
annotation object.
*/
- (void)addAnnotation:(id<MLNAnnotation>)annotation;
@@ -811,14 +804,14 @@ around the returned camera object if it were set as the receiver’s camera.
/**
Adds an array of annotations to the map view.
@note `MLNMultiPolyline`, `MLNMultiPolygon`, and `MLNShapeCollection` objects
cannot be added to the map view at this time. Nor can `MLNMultiPoint`
objects that are not instances of `MLNPolyline` or `MLNPolygon`. Any
@note ``MLNMultiPolyline``, ``MLNMultiPolyline``, and ``MLNMultiPolyline`` objects
cannot be added to the map view at this time. Nor can ``MLNMultiPoint``
objects that are not instances of ``MLNPolyline`` or ``MLNPolyline``. Any
multipoint, multipolyline, multipolygon, or shape collection objects that
are specified are silently ignored.
@param annotations An array of annotation objects. Each object in the array
must conform to the `MLNAnnotation` protocol. The map view retains each
must conform to the ``MLNAnnotation`` protocol. The map view retains each
individual annotation object.
*/
- (void)addAnnotations:(NSArray<id<MLNAnnotation>> *)annotations;
@@ -827,7 +820,7 @@ around the returned camera object if it were set as the receiver’s camera.
The complete list of annotations associated with the receiver that are
currently visible.
The objects in this array must adopt the `MLNAnnotation` protocol. If no
The objects in this array must adopt the ``MLNAnnotation`` protocol. If no
annotations are associated with the map view or if no annotations associated
with the map view are currently visible, the value of this property is `nil`.
*/
@@ -841,7 +834,7 @@ around the returned camera object if it were set as the receiver’s camera.
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 `MLNAnnotation` protocol.
the ``MLNAnnotation`` protocol.
*/
- (void)removeAnnotation:(id<MLNAnnotation>)annotation;
@@ -854,14 +847,14 @@ around the returned camera object if it were set as the receiver’s camera.
this method only when you want to hide or delete the given annotations.
@param annotations The array of annotation objects to remove. Objects in the
array must conform to the `MLNAnnotation` protocol.
array must conform to the ``MLNAnnotation`` protocol.
*/
- (void)removeAnnotations:(NSArray<id<MLNAnnotation>> *)annotations;
/**
Returns a reusable annotation image object associated with its identifier.
For performance reasons, you should generally reuse `MLNAnnotationImage`
For performance reasons, you should generally reuse ``MLNAnnotationImage``
objects for identical-looking annotations in your map views. Dequeueing saves
time and memory during performance-critical operations such as scrolling.
@@ -879,7 +872,7 @@ around the returned camera object if it were set as the receiver’s camera.
the given rectangle.
@param rect A rectangle expressed in the map view’s coordinate system.
@return An array of objects that adopt the `MLNAnnotation` protocol or `nil` if
@return An array of objects that adopt the ``MLNAnnotation`` protocol or `nil` if
no annotations associated with the map view are currently visible in the
rectangle.
*/
@@ -893,7 +886,7 @@ around the returned camera object if it were set as the receiver’s camera.
Assigning a new array to this property selects only the first annotation in the
array.
If the annotation is of type `MLNPointAnnotation` and is offscreen, the map is
If the annotation is of type ``MLNPointAnnotation`` and is offscreen, the map is
panned so that the annotation and its callout are brought just onscreen. The
annotation is *not* centered within the viewport.
@@ -905,7 +898,7 @@ around the returned camera object if it were set as the receiver’s camera.
/**
Selects an annotation and displays a callout popover for it.
If the annotation is of type `MLNPointAnnotation` and is offscreen, the map is
If the annotation is of type ``MLNPointAnnotation`` and is offscreen, the map is
panned so that the annotation and its callout are brought just onscreen. The
annotation is *not* centered within the viewport.
@@ -955,7 +948,7 @@ around the returned camera object if it were set as the receiver’s camera.
/**
The complete list of overlays associated with the receiver. (read-only)
The objects in this array must adopt the `MLNOverlay` protocol. If no
The objects in this array must adopt the ``MLNOverlay`` protocol. If no
overlays are associated with the map view, the value of this property is
empty array.
*/
@@ -967,7 +960,7 @@ around the returned camera object if it were set as the receiver’s camera.
To remove an overlay from a map, use the `-removeOverlay:` method.
@param overlay The overlay object to add. This object must conform to the
`MLNOverlay` protocol.
``MLNOverlay`` protocol.
*/
- (void)addOverlay:(id<MLNOverlay>)overlay;
@@ -977,7 +970,7 @@ around the returned camera object if it were set as the receiver’s camera.
To remove multiple overlays from a map, use the `-removeOverlays:` method.
@param overlays An array of objects, each of which must conform to the
`MLNOverlay` protocol.
``MLNOverlay`` protocol.
*/
- (void)addOverlays:(NSArray<id<MLNOverlay>> *)overlays;
@@ -996,7 +989,7 @@ around the returned camera object if it were set as the receiver’s camera.
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 `MLNOverlay`
@param overlays An array of objects, each of which conforms to the ``MLNOverlay``
protocol.
*/
- (void)removeOverlays:(NSArray<id<MLNOverlay>> *)overlays;
@@ -1012,7 +1005,7 @@ around the returned camera object if it were set as the receiver’s camera.
information about searching for map features, see that method’s documentation.
@param point A point expressed in the map view’s coordinate system.
@return An array of objects conforming to the `MLNFeature` protocol that
@return An array of objects conforming to the ``MLNFeature`` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(NSPoint)point
@@ -1032,7 +1025,7 @@ around the returned camera object if it were set as the receiver’s camera.
@param styleLayerIdentifiers A set of strings that correspond to the names of
layers defined in the current style. Only the features contained in these
layers are included in the returned array.
@return An array of objects conforming to the `MLNFeature` protocol that
@return An array of objects conforming to the ``MLNFeature`` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(NSPoint)point
@@ -1047,8 +1040,8 @@ around the returned camera object if it were set as the receiver’s camera.
Each object in the returned array represents a feature rendered by the
current style and provides access to attributes specified by the relevant map
content sources. The returned array includes features loaded by
`MLNShapeSource` and `MLNVectorTileSource` objects but does not include
anything from `MLNRasterTileSource` objects, or from video or canvas sources,
``MLNShapeSource`` and ``MLNShapeSource`` objects but does not include
anything from ``MLNRasterTileSource`` objects, or from video or canvas sources,
which are unsupported by this SDK.
The returned features are drawn by a style layer in the current style. For
@@ -1058,7 +1051,7 @@ around the returned camera object if it were set as the receiver’s camera.
property set to `bus`. If you pass a point corresponding to the location of a
bus stop into this method, the bus stop feature does not appear in the
resulting array. On the other hand, if the style does include bus stops, an
`MLNFeature` object representing that bus stop is returned and its
``MLNFeature`` object representing that bus stop is returned and its
`attributes` dictionary has the `maki` key set to `bus` (along with other
attributes). The dictionary contains only the attributes provided by the
tile source; it does not include computed attribute values or rules about how
@@ -1081,23 +1074,16 @@ around the returned camera object if it were set as the receiver’s camera.
Only visible features are returned. To obtain features regardless of
visibility, use the
`-[MLNVectorTileSource featuresInSourceLayersWithIdentifiers:predicate:]` and
`-[MLNShapeSource featuresMatchingPredicate:]` methods on the relevant sources.
``MLNVectorTileSource/featuresInSourceLayersWithIdentifiers:predicate:`` and
``MLNShapeSource/featuresMatchingPredicate:`` methods on the relevant sources.
@note Layer identifiers are not guaranteed to exist across styles or different
versions of the same style. Applications that use this API must first set
the style URL to an explicitly versioned style using a convenience method
like `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the
default style’s layers over time.
@param point A point expressed in the map view’s coordinate system.
@param styleLayerIdentifiers A set of strings that correspond to the names of
layers defined in the current style. Only the features contained in these
layers are included in the returned array.
@param predicate A predicate to filter the returned features.
@return An array of objects conforming to the `MLNFeature` protocol that
@return An array of objects conforming to the ``MLNFeature`` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(NSPoint)point
@@ -1116,7 +1102,7 @@ around the returned camera object if it were set as the receiver’s camera.
information about searching for map features, see that method’s documentation.
@param rect A rectangle expressed in the map view’s coordinate system.
@return An array of objects conforming to the `MLNFeature` protocol that
@return An array of objects conforming to the ``MLNFeature`` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(NSRect)rect NS_SWIFT_NAME(visibleFeatures(in:));
@@ -1135,7 +1121,7 @@ around the returned camera object if it were set as the receiver’s camera.
@param styleLayerIdentifiers A set of strings that correspond to the names of
layers defined in the current style. Only the features contained in these
layers are included in the returned array.
@return An array of objects conforming to the `MLNFeature` protocol that
@return An array of objects conforming to the ``MLNFeature`` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(NSRect)rect
@@ -1151,8 +1137,8 @@ around the returned camera object if it were set as the receiver’s camera.
Each object in the returned array represents a feature rendered by the
current style and provides access to attributes specified by the relevant map
content sources. The returned array includes features loaded by
`MLNShapeSource` and `MLNVectorTileSource` objects but does not include
anything from `MLNRasterTileSource` objects, or from video or canvas sources,
``MLNShapeSource`` and ``MLNShapeSource`` objects but does not include
anything from ``MLNRasterTileSource`` objects, or from video or canvas sources,
which are unsupported by this SDK.
The returned features are drawn by a style layer in the current style. For
@@ -1161,7 +1147,7 @@ around the returned camera object if it were set as the receiver’s camera.
but none of the specified style layers includes features that have the `maki`
property set to `bus`. If you pass a rectangle containing the location of a bus
stop into this method, the bus stop feature does not appear in the resulting
array. On the other hand, if the style does include bus stops, an `MLNFeature`
array. On the other hand, if the style does include bus stops, an ``MLNFeature``
object representing that bus stop is returned and its `attributes` dictionary
has the `maki` key set to `bus` (along with other attributes). The dictionary
contains only the attributes provided by the tile source; it does not include
@@ -1186,23 +1172,15 @@ around the returned camera object if it were set as the receiver’s camera.
Only visible features are returned. To obtain features regardless of
visibility, use the
`-[MLNVectorTileSource featuresInSourceLayersWithIdentifiers:predicate:]` and
`-[MLNShapeSource featuresMatchingPredicate:]` methods on the relevant sources.
@note Layer identifiers are not guaranteed to exist across styles or different
versions of the same style. Applications that use this API must first set
the style URL to an explicitly versioned style using a convenience method
like `+[MLNStyle outdoorsStyleURLWithVersion:]`, `MLNMapView`’s “Style URL”
inspectable in Interface Builder, or a manually constructed `NSURL`. This
approach also avoids layer identifer name changes that will occur in the
default style’s layers over time.
``MLNVectorTileSource/featuresInSourceLayersWithIdentifiers:predicate:`` and
``MLNShapeSource/featuresMatchingPredicate:`` methods on the relevant sources.
@param rect A rectangle expressed in the map view’s coordinate system.
@param styleLayerIdentifiers A set of strings that correspond to the names of
layers defined in the current style. Only the features contained in these
layers are included in the returned array.
@param predicate A predicate to filter the returned features.
@return An array of objects conforming to the `MLNFeature` protocol that
@return An array of objects conforming to the ``MLNFeature`` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(NSRect)rect

View File

@@ -2431,7 +2431,7 @@ public:
: NSMaxXEdge);
// The following will do nothing if the positioning rect is not on-screen. See
// `-[MLNMapView updateAnnotationCallouts]` for presenting the callout when the selected
// ``MLNMapView/updateAnnotationCallouts`` for presenting the callout when the selected
// annotation comes back on-screen.
[callout showRelativeToRect:positioningRect ofView:self preferredEdge:edge];
}

View File

@@ -13,9 +13,9 @@ NS_ASSUME_NONNULL_BEGIN
@protocol MLNAnnotation;
/**
The `MLNMapViewDelegate` protocol defines a set of optional methods that you
can use to receive messages from an `MLNMapView` instance. Because many map
operations require the `MLNMapView` class to load data asynchronously, the map
The ``MLNMapViewDelegate`` protocol defines a set of optional methods that you
can use to receive messages from an ``MLNMapView`` instance. Because many map
operations require the ``MLNMapView`` 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 information about
annotations displayed on the map, such as the styles and interaction modes to
@@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
This method is called as the currently displayed map camera changes as part of
an animation, whether due to a user gesture or due to a call to a method such
as `-[MLNMapView setCamera:animated:]`. This method can be called before
as ``MLNMapView/setCamera:animated:``. This method can be called before
`-mapViewDidFinishLoadingMap:` is called.
During the animation, this method may be called many times to report updates
@@ -205,7 +205,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Tells the delegate that the `mapView` is missing an image. The image should be added synchronously
with `-[MLNStyle setImage:forName:]` to be rendered on the current zoom level. When loading icons
with ``MLNStyle/setImage:forName:`` to be rendered on the current zoom level. When loading icons
asynchronously, you can load a placeholder image and replace it when your image has loaded.
@param mapView The map view that is loading the image.
@@ -370,7 +370,7 @@ NS_ASSUME_NONNULL_BEGIN
such as `title` and `subtitle`.
If each annotation should have an identical callout, you can set the
`MLNMapView.calloutViewController` property instead.
``MLNMapView/calloutViewController`` property instead.
@param mapView The map view that is requesting a callout view controller.
@param annotation The object representing the annotation.