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

@@ -371,7 +371,7 @@ global.propertyDoc = function (propertyName, property, layerType, kind) {
let layoutProperties = spec[`layout_${layerType}`] || []; let layoutProperties = spec[`layout_${layerType}`] || [];
let paintProperties = spec[`paint_${layerType}`] || []; let paintProperties = spec[`paint_${layerType}`] || [];
if (symbol in layoutProperties || symbol in paintProperties) { if (symbol in layoutProperties || symbol in paintProperties) {
return '`MLN' + camelize(layerType) + 'StyleLayer.' + camelizeWithLeadingLowercase(symbol) + '`'; return '``MLN' + camelize(layerType) + 'StyleLayer/' + camelizeWithLeadingLowercase(symbol) + '``';
} }
} }
if ('values' in property && Object.keys(property.values).indexOf(symbol) !== -1) { if ('values' in property && Object.keys(property.values).indexOf(symbol) !== -1) {
@@ -508,11 +508,11 @@ global.describeType = function (property) {
case 'translate': case 'translate':
return '`CGVector`'; return '`CGVector`';
case 'position': case 'position':
return '`MLNSphericalPosition`'; return '``MLNSphericalPosition``';
case 'anchor': case 'anchor':
return '`MLNTextAnchor` array'; return '``MLNTextAnchor`` array';
case 'mode': case 'mode':
return '`MLNTextWritingMode` array'; return '``MLNTextWritingMode`` array';
default: default:
return 'array'; return 'array';
} }
@@ -593,7 +593,7 @@ global.describeValue = function (value, property, layerType) {
case 'translate': case 'translate':
return 'an `NSValue` object containing a `CGVector` struct set to' + ` ${formatNumber(value[0])}${units} rightward and ${formatNumber(value[1])}${units} downward`; return 'an `NSValue` object containing a `CGVector` struct set to' + ` ${formatNumber(value[0])}${units} rightward and ${formatNumber(value[1])}${units} downward`;
case 'position': case 'position':
return 'an `MLNSphericalPosition` struct set to' + ` ${formatNumber(value[0])} radial, ${formatNumber(value[1])} azimuthal and ${formatNumber(value[2])} polar`; return 'an ``MLNSphericalPosition`` struct set to' + ` ${formatNumber(value[0])} radial, ${formatNumber(value[1])} azimuthal and ${formatNumber(value[2])} polar`;
default: default:
return 'the array `' + value.join('`, `') + '`'; return 'the array `' + value.join('`, `') + '`';
} }

View File

@@ -1,47 +1,47 @@
{ {
"light-cocoa-doc": "An `MLNLight` object represents the light source for extruded geometries in `MLNStyle`.\n\n### Example\n```swift\n```\n\n#### Related examples\nSee the <a href=\"https://docs.mapbox.com/ios/maps/examples/light-example/\">Adjust light of 3D buildings</a> to learn how to create and modify the light source for 3D geometries.", "light-cocoa-doc": "An ``MLNLight`` object represents the light source for extruded geometries in ``MLNLight``.\n\n### Example\n```swift\n```\n\n#### Related examples\nSee the <a href=\"https://docs.mapbox.com/ios/maps/examples/light-example/\">Adjust light of 3D buildings</a> to learn how to create and modify the light source for 3D geometries.",
"light": { "light": {
"position": { "position": {
"doc": "Position of the `MLNLight` source relative to lit (extruded) geometries, in a `MLNSphericalPosition` struct [radial coordinate, azimuthal angle, polar angle] where radial indicates the distance from the center of the base of an object to its light, azimuthal indicates the position of the light relative to 0° (0° when `MLNLight.anchor` is set to `MLNLightAnchorViewport` corresponds to the top of the viewport, or 0° when `MLNLight.anchor` is set to `MLNLightAnchorMap` corresponds to due north, and degrees proceed clockwise), and polar indicates the height of the light (from 0°, directly above, to 180°, directly below).", "doc": "Position of the ``MLNLight`` source relative to lit (extruded) geometries, in a ``MLNLight`` struct [radial coordinate, azimuthal angle, polar angle] where radial indicates the distance from the center of the base of an object to its light, azimuthal indicates the position of the light relative to 0° (0° when ``MLNLight/anchor`` is set to ``MLNLight`` corresponds to the top of the viewport, or 0° when ``MLNLight/anchor`` is set to ``MLNLight`` corresponds to due north, and degrees proceed clockwise), and polar indicates the height of the light (from 0°, directly above, to 180°, directly below).",
"examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/light-example/\">Adjust light of 3D buildings</a> example to learn how to create and modify the position of value of an `MLNLight` object for 3D geometries." "examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/light-example/\">Adjust light of 3D buildings</a> example to learn how to create and modify the position of value of an ``MLNLight`` object for 3D geometries."
} }
}, },
"layer": { "layer": {
"type": { "type": {
"values": { "values": {
"fill": { "fill": {
"doc": "An `MLNFillStyleLayer` is a style layer that renders one or more filled (and optionally stroked) polygons on the map.\n\nUse a fill style layer to configure the visual appearance of polygon or multipolygon features. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNPolygon`, `MLNPolygonFeature`, `MLNMultiPolygon`, or `MLNMultiPolygonFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.", "doc": "An ``MLNFillStyleLayer`` is a style layer that renders one or more filled (and optionally stroked) polygons on the map.\n\nUse a fill style layer to configure the visual appearance of polygon or multipolygon features. These features can come from vector tiles loaded by an ``MLNFillStyleLayer`` object, or they can be ``MLNFillStyleLayer``, ``MLNFillStyleLayer``, ``MLNFillStyleLayer``, or ``MLNFillStyleLayer`` instances in an ``MLNFillStyleLayer`` or ``MLNFillStyleLayer`` object.",
"examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/select-layer/\">Select a feature within a layer</a> example to learn how to use a `TERNARY` expression to modify the `fillOpacity` of an `MLNFillStyleLayer` object. See the <a href=\"https://docs.mapbox.com/ios/maps/examples/fill-pattern/\">Add a pattern to a polygon</a> example to learn how to use an image to add pattern to the features styled by a `MLNFillStyleLayer`." "examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/select-layer/\">Select a feature within a layer</a> example to learn how to use a `TERNARY` expression to modify the `fillOpacity` of an ``MLNFillStyleLayer`` object. See the <a href=\"https://docs.mapbox.com/ios/maps/examples/fill-pattern/\">Add a pattern to a polygon</a> example to learn how to use an image to add pattern to the features styled by a ``MLNFillStyleLayer``."
}, },
"fill-extrusion": { "fill-extrusion": {
"doc": "An `MLNFillExtrusionStyleLayer` is a style layer that renders one or more 3D extruded polygons on the map.\n\nUse a fill-extrusion style layer to configure the visual appearance of polygon or multipolygon features. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNPolygon`, `MLNPolygonFeature`, `MLNMultiPolygon`, or `MLNMultiPolygonFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.", "doc": "An ``MLNFillExtrusionStyleLayer`` is a style layer that renders one or more 3D extruded polygons on the map.\n\nUse a fill-extrusion style layer to configure the visual appearance of polygon or multipolygon features. These features can come from vector tiles loaded by an ``MLNFillExtrusionStyleLayer`` object, or they can be ``MLNFillExtrusionStyleLayer``, ``MLNFillExtrusionStyleLayer``, ``MLNFillExtrusionStyleLayer``, or ``MLNFillExtrusionStyleLayer`` instances in an ``MLNFillExtrusionStyleLayer`` or ``MLNFillExtrusionStyleLayer`` object.",
"examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/extrusions/\">Display 3D buildings</a> example to learn how to add and style 3D layers on a map." "examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/extrusions/\">Display 3D buildings</a> example to learn how to add and style 3D layers on a map."
}, },
"line": { "line": {
"doc": "An `MLNLineStyleLayer` is a style layer that renders one or more stroked polylines on the map.\n\nUse a line style layer to configure the visual appearance of polyline or multipolyline features. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNPolyline`, `MLNPolylineFeature`, `MLNMultiPolyline`, or `MLNMultiPolylineFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.", "doc": "An ``MLNLineStyleLayer`` is a style layer that renders one or more stroked polylines on the map.\n\nUse a line style layer to configure the visual appearance of polyline or multipolyline features. These features can come from vector tiles loaded by an ``MLNLineStyleLayer`` object, or they can be ``MLNLineStyleLayer``, ``MLNLineStyleLayer``, ``MLNLineStyleLayer``, or ``MLNLineStyleLayer`` instances in an ``MLNLineStyleLayer`` or ``MLNLineStyleLayer`` object.",
"examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/shape-collection/\">Add multiple shapes from a single shape source</a> example to learn how to add a line to your map using this style layer. See the <a href=\"https://docs.mapbox.com/ios/maps/examples/runtime-add-line/\">Add a line style layer from GeoJSON</a> example to learn how to add and style line data to an `MLNMapView` object at runtime." "examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/shape-collection/\">Add multiple shapes from a single shape source</a> example to learn how to add a line to your map using this style layer. See the <a href=\"https://docs.mapbox.com/ios/maps/examples/runtime-add-line/\">Add a line style layer from GeoJSON</a> example to learn how to add and style line data to an ``MLNMapView`` object at runtime."
}, },
"symbol": { "symbol": {
"doc": "An `MLNSymbolStyleLayer` is a style layer that renders icon and text labels at points or along lines on the map.\n\nUse a symbol style layer to configure the visual appearance of feature labels. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNShape` or `MLNFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.", "doc": "An ``MLNSymbolStyleLayer`` is a style layer that renders icon and text labels at points or along lines on the map.\n\nUse a symbol style layer to configure the visual appearance of feature labels. These features can come from vector tiles loaded by an ``MLNSymbolStyleLayer`` object, or they can be ``MLNSymbolStyleLayer`` or ``MLNSymbolStyleLayer`` instances in an ``MLNSymbolStyleLayer`` or ``MLNSymbolStyleLayer`` object.",
"examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/runtime-multiple-annotations/\">Dynamically style interactive points</a> and <a href=\"https://docs.mapbox.com/ios/maps/examples/clustering-with-images/\">Use images to cluster point data</a> examples learn how to style data on your map using this layer." "examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/runtime-multiple-annotations/\">Dynamically style interactive points</a> and <a href=\"https://docs.mapbox.com/ios/maps/examples/clustering-with-images/\">Use images to cluster point data</a> examples learn how to style data on your map using this layer."
}, },
"circle": { "circle": {
"doc": "An `MLNCircleStyleLayer` is a style layer that renders one or more filled circles on the map.\n\nUse a circle style layer to configure the visual appearance of point or point collection features. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNPointAnnotation`, `MLNPointFeature`, `MLNPointCollection`, or `MLNPointCollectionFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.\n\nA circle style layer renders circles whose radii are measured in screen units. To display circles on the map whose radii correspond to real-world distances, use many-sided regular polygons and configure their appearance using an `MLNFillStyleLayer` object.", "doc": "An ``MLNCircleStyleLayer`` is a style layer that renders one or more filled circles on the map.\n\nUse a circle style layer to configure the visual appearance of point or point collection features. These features can come from vector tiles loaded by an ``MLNCircleStyleLayer`` object, or they can be ``MLNCircleStyleLayer``, ``MLNCircleStyleLayer``, ``MLNCircleStyleLayer``, or ``MLNCircleStyleLayer`` instances in an ``MLNCircleStyleLayer`` or ``MLNCircleStyleLayer`` object.\n\nA circle style layer renders circles whose radii are measured in screen units. To display circles on the map whose radii correspond to real-world distances, use many-sided regular polygons and configure their appearance using an ``MLNCircleStyleLayer`` object.",
"examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/dds-circle-layer/\">Data-driven circles</a>, <a href=\"https://docs.mapbox.com/ios/maps/examples/shape-collection/\">Add multiple shapes from a single shape source</a>, and <a href=\"https://docs.mapbox.com/ios/maps/examples/clustering/\">Cluster point data</a> examples to learn how to add circles to your map using this style layer." "examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/dds-circle-layer/\">Data-driven circles</a>, <a href=\"https://docs.mapbox.com/ios/maps/examples/shape-collection/\">Add multiple shapes from a single shape source</a>, and <a href=\"https://docs.mapbox.com/ios/maps/examples/clustering/\">Cluster point data</a> examples to learn how to add circles to your map using this style layer."
}, },
"heatmap": { "heatmap": {
"doc": "An `MLNHeatmapStyleLayer` is a style layer that renders a <a href=\"https://en.wikipedia.org/wiki/Heat_map\">heatmap</a>.\n\nA heatmap visualizes the spatial distribution of a large, dense set of point data, using color to avoid cluttering the map with individual points at low zoom levels. The points are weighted by an attribute you specify. Use a heatmap style layer in conjunction with point or point collection features. These features can come from vector tiles loaded by an `MLNVectorTileSource` object, or they can be `MLNPointAnnotation`, `MLNPointFeature`, `MLNPointCollection`, or `MLNPointCollectionFeature` instances in an `MLNShapeSource` or `MLNComputedShapeSource` object.\n\nConsider accompanying a heatmap style layer with an `MLNCircleStyleLayer` or `MLNSymbolStyleLayer` at high zoom levels. If you are unsure whether the point data in an `MLNShapeSource` is dense enough to warrant a heatmap, you can alternatively cluster the source using the `MLNShapeSourceOptionClustered` option and render the data using an `MLNCircleStyleLayer` or `MLNSymbolStyleLayer`.", "doc": "An ``MLNHeatmapStyleLayer`` is a style layer that renders a <a href=\"https://en.wikipedia.org/wiki/Heat_map\">heatmap</a>.\n\nA heatmap visualizes the spatial distribution of a large, dense set of point data, using color to avoid cluttering the map with individual points at low zoom levels. The points are weighted by an attribute you specify. Use a heatmap style layer in conjunction with point or point collection features. These features can come from vector tiles loaded by an ``MLNHeatmapStyleLayer`` object, or they can be ``MLNHeatmapStyleLayer``, ``MLNHeatmapStyleLayer``, ``MLNHeatmapStyleLayer``, or ``MLNHeatmapStyleLayer`` instances in an ``MLNHeatmapStyleLayer`` or ``MLNHeatmapStyleLayer`` object.\n\nConsider accompanying a heatmap style layer with an ``MLNHeatmapStyleLayer`` or ``MLNHeatmapStyleLayer`` at high zoom levels. If you are unsure whether the point data in an ``MLNHeatmapStyleLayer`` is dense enough to warrant a heatmap, you can alternatively cluster the source using the ``MLNHeatmapStyleLayer`` option and render the data using an ``MLNHeatmapStyleLayer`` or ``MLNHeatmapStyleLayer``.",
"examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/heatmap-example/\">Create a heatmap layer</a> example to learn how to add this style layer to your map." "examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/heatmap-example/\">Create a heatmap layer</a> example to learn how to add this style layer to your map."
}, },
"raster": { "raster": {
"doc": "An `MLNRasterStyleLayer` is a style layer that renders georeferenced raster imagery on the map, especially raster tiles.\n\nUse a raster style layer to configure the color parameters of raster tiles loaded by an `MLNRasterTileSource` object or raster images loaded by an `MLNImageSource` object. For example, you could use a raster style layer to render <a href=\"https://www.mapbox.com/satellite/\">Mapbox Satellite</a> imagery, a <a href=\"https://docs.mapbox.com/help/glossary/tileset/#raster-tilesets\">raster tile set</a> uploaded to Mapbox Studio, or a raster map authored in <a href=\"https://tilemill-project.github.io/tilemill/\">TileMill</a>, the classic Mapbox Editor, or Mapbox Studio Classic.\n\nRaster images may also be used as icons or patterns in a style layer. To register an image for use as an icon or pattern, use the `-[MLNStyle setImage:forName:]` method. To configure a point annotation’s image, use the `MLNAnnotationImage` class.", "doc": "An ``MLNRasterStyleLayer`` is a style layer that renders georeferenced raster imagery on the map, especially raster tiles.\n\nUse a raster style layer to configure the color parameters of raster tiles loaded by an ``MLNRasterStyleLayer`` object or raster images loaded by an ``MLNRasterStyleLayer`` object. For example, you could use a raster style layer to render <a href=\"https://www.mapbox.com/satellite/\">Mapbox Satellite</a> imagery, a <a href=\"https://docs.mapbox.com/help/glossary/tileset/#raster-tilesets\">raster tile set</a> uploaded to Mapbox Studio, or a raster map authored in <a href=\"https://tilemill-project.github.io/tilemill/\">TileMill</a>, the classic Mapbox Editor, or Mapbox Studio Classic.\n\nRaster images may also be used as icons or patterns in a style layer. To register an image for use as an icon or pattern, use the ``MLNStyle/setImage:forName:`` method. To configure a point annotation’s image, use the ``MLNRasterStyleLayer`` class.",
"examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/image-source/\">Add an image</a> and <a href=\"https://docs.mapbox.com/ios/maps/examples/source-custom-raster/\">Add raster imagery</a> examples to learn how to add imagery with this style layer." "examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/image-source/\">Add an image</a> and <a href=\"https://docs.mapbox.com/ios/maps/examples/source-custom-raster/\">Add raster imagery</a> examples to learn how to add imagery with this style layer."
}, },
"hillshade": { "hillshade": {
"doc": "An `MLNHillshadeStyleLayer` is a style layer that renders raster <a href=\"https://en.wikipedia.org/wiki/Digital_elevation_model\">digital elevation model</a> (DEM) tiles on the map.\n\nUse a hillshade style layer to configure the color parameters of raster tiles loaded by an `MLNRasterDEMSource` object. For example, you could use a hillshade style layer to render <a href=\"https://docs.mapbox.com/help/troubleshooting/access-elevation-data/#mapbox-terrain-rgb\">Mapbox Terrain-RGB</a> data.\n\nTo display posterized hillshading based on vector shapes, as with the <a href=\"https://www.mapbox.com/vector-tiles/mapbox-terrain/\">Mapbox Terrain</a> source, use an `MLNVectorTileSource` object in conjunction with several `MLNFillStyleLayer` objects." "doc": "An ``MLNHillshadeStyleLayer`` is a style layer that renders raster <a href=\"https://en.wikipedia.org/wiki/Digital_elevation_model\">digital elevation model</a> (DEM) tiles on the map.\n\nUse a hillshade style layer to configure the color parameters of raster tiles loaded by an ``MLNHillshadeStyleLayer`` object. For example, you could use a hillshade style layer to render <a href=\"https://docs.mapbox.com/help/troubleshooting/access-elevation-data/#mapbox-terrain-rgb\">Mapbox Terrain-RGB</a> data.\n\nTo display posterized hillshading based on vector shapes, as with the <a href=\"https://www.mapbox.com/vector-tiles/mapbox-terrain/\">Mapbox Terrain</a> source, use an ``MLNHillshadeStyleLayer`` object in conjunction with several ``MLNHillshadeStyleLayer`` objects."
}, },
"background": { "background": {
"doc": "An `MLNBackgroundStyleLayer` is a style layer that covers the entire map. Use a background style layer to configure a color or pattern to show below all other map content. If the style’s other layers use the Mapbox Streets source, the background style layer is responsible for drawing land, whereas the oceans and other bodies of water are drawn by `MLNFillStyleLayer` objects.\n\nA background style layer is typically the bottommost layer in a style, because it covers the entire map and can occlude any layers below it. You can therefore access it by getting the last item in the `MLNStyle.layers` array.\n\nIf the background style layer is transparent or omitted from the style, any portion of the map view that does not show another style layer is transparent." "doc": "An ``MLNBackgroundStyleLayer`` is a style layer that covers the entire map. Use a background style layer to configure a color or pattern to show below all other map content. If the style’s other layers use the Mapbox Streets source, the background style layer is responsible for drawing land, whereas the oceans and other bodies of water are drawn by ``MLNBackgroundStyleLayer`` objects.\n\nA background style layer is typically the bottommost layer in a style, because it covers the entire map and can occlude any layers below it. You can therefore access it by getting the last item in the ``MLNStyle/layers`` array.\n\nIf the background style layer is transparent or omitted from the style, any portion of the map view that does not show another style layer is transparent."
} }
} }
} }
@@ -67,11 +67,11 @@
"doc": "Offset distance of icon from its anchor." "doc": "Offset distance of icon from its anchor."
}, },
"icon-image": { "icon-image": {
"doc": "Name of a style image to use for drawing an image background.\n\nUse the `+[MLNStyle setImage:forName:]` method to associate an image with a name that you can set this property to.\n\nWithin a constant string value, a feature attribute name enclosed in curly braces (e.g., `{token}`) is replaced with the value of the named attribute. Tokens inside non-constant expressions are ignored; instead, use `mgl_join:` and key path expressions.", "doc": "Name of a style image to use for drawing an image background.\n\nUse the ``MLNStyle/setImage:forName:`` method to associate an image with a name that you can set this property to.\n\nWithin a constant string value, a feature attribute name enclosed in curly braces (e.g., `{token}`) is replaced with the value of the named attribute. Tokens inside non-constant expressions are ignored; instead, use `mgl_join:` and key path expressions.",
"examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/clustering-with-images/\">Use images to cluster point data</a> example to learn how to dynamically set your icons with an expression." "examples": "See the <a href=\"https://docs.mapbox.com/ios/maps/examples/clustering-with-images/\">Use images to cluster point data</a> example to learn how to dynamically set your icons with an expression."
}, },
"symbol-avoid-edges": { "symbol-avoid-edges": {
"doc": "Whether symbols in this layer avoid colliding with symbols in adjacent tiles.\n\nIf this property is set to `true`, symbols in this layer avoid crossing the edge of a tile. You should set this property to `true` if the backing vector tiles don’t have enough padding to prevent collisions, or if this layer’s `symbolPlacement` property is set to `MLNSymbolPlacementPoint` but this layer is above a symbol layer whose `symbolPlacement` property is set to `MLNSymbolPlacementLine`. You do not need to enable this property to prevent clipped labels at tile boundaries." "doc": "Whether symbols in this layer avoid colliding with symbols in adjacent tiles.\n\nIf this property is set to `true`, symbols in this layer avoid crossing the edge of a tile. You should set this property to `true` if the backing vector tiles don’t have enough padding to prevent collisions, or if this layer’s `symbolPlacement` property is set to ``MLNSymbolPlacement/MLNSymbolPlacementPoint`` but this layer is above a symbol layer whose `symbolPlacement` property is set to ``MLNSymbolPlacement/MLNSymbolPlacementPoint``. You do not need to enable this property to prevent clipped labels at tile boundaries."
}, },
"text-field": { "text-field": {
"doc": "Value to use for a text label.\n\nWithin a constant string value, a feature attribute name enclosed in curly braces (e.g., `{token}`) is replaced with the value of the named attribute. Tokens inside non-constant expressions are ignored; instead, use `mgl_join:` and key path expressions.", "doc": "Value to use for a text label.\n\nWithin a constant string value, a feature attribute name enclosed in curly braces (e.g., `{token}`) is replaced with the value of the named attribute. Tokens inside non-constant expressions are ignored; instead, use `mgl_join:` and key path expressions.",
@@ -115,7 +115,7 @@
}, },
"paint_line": { "paint_line": {
"line-gradient": { "line-gradient": {
"doc": "The color gradient with which the line will be drawn. This property only has an effect on lines defined by an `MLNShapeSource` whose `MLNShapeSourceOptionLineDistanceMetrics` option is set to `YES`." "doc": "The color gradient with which the line will be drawn. This property only has an effect on lines defined by an ``MLNShapeSource`` whose ``MLNShapeSource`` option is set to `YES`."
}, },
"line-pattern": { "line-pattern": {
"doc": "Name of image in style images to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512)." "doc": "Name of image in style images to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512)."

View File

@@ -5,7 +5,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNAnnotation` protocol is used to provide annotation-related information The ``MLNAnnotation`` protocol is used to provide annotation-related information
to a map view. To use this protocol, you adopt it in any custom objects that 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 store or represent annotation data. Each object then serves as the source of
information about a single map annotation and provides critical information, information about a single map annotation and provides critical information,
@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
#### Related examples #### Related examples
TODO: Annotation models TODO: Annotation models
TODO: Annotation views, learn how to add objects that follow the TODO: Annotation views, learn how to add objects that follow the
`MLNAnnotation` protocol ``MLNAnnotation`` protocol
*/ */
@protocol MLNAnnotation <NSObject> @protocol MLNAnnotation <NSObject>

View File

@@ -2,13 +2,13 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** Options for `MLNAttributedExpression.attributes`. */ /** Options for ``MLNAttributedExpression/attributes``. */
typedef NSString *MLNAttributedExpressionKey NS_TYPED_ENUM; typedef NSString *MLNAttributedExpressionKey NS_TYPED_ENUM;
/** The font name string array expression used to format the text. */ /** The font name string array expression used to format the text. */
FOUNDATION_EXTERN MLN_EXPORT MLNAttributedExpressionKey const MLNFontNamesAttribute; FOUNDATION_EXTERN MLN_EXPORT MLNAttributedExpressionKey const MLNFontNamesAttribute;
/** The font scale number expression relative to `MLNSymbolStyleLayer.textFontSize` used to format /** The font scale number expression relative to ``MLNSymbolStyleLayer/textFontSize`` used to format
* the text. */ * the text. */
FOUNDATION_EXTERN MLN_EXPORT MLNAttributedExpressionKey const MLNFontScaleAttribute; FOUNDATION_EXTERN MLN_EXPORT MLNAttributedExpressionKey const MLNFontScaleAttribute;
@@ -16,7 +16,7 @@ FOUNDATION_EXTERN MLN_EXPORT MLNAttributedExpressionKey const MLNFontScaleAttrib
FOUNDATION_EXTERN MLN_EXPORT MLNAttributedExpressionKey const MLNFontColorAttribute; FOUNDATION_EXTERN MLN_EXPORT MLNAttributedExpressionKey const MLNFontColorAttribute;
/** /**
An `MLNAttributedExpression` object associates text formatting attibutes (such as font size or An ``MLNAttributedExpression`` object associates text formatting attibutes (such as font size or
font names) to an `NSExpression`. font names) to an `NSExpression`.
### Example ### Example
@@ -44,9 +44,9 @@ MLN_EXPORT
The formatting attributes dictionary. The formatting attributes dictionary.
Key | Value Type Key | Value Type
--- | --- --- | ---
`MLNFontNamesAttribute` | An `NSExpression` evaluating to an `NSString` array. ``MLNFontNamesAttribute`` | An `NSExpression` evaluating to an `NSString` array.
`MLNFontScaleAttribute` | An `NSExpression` evaluating to an `NSNumber` value. ``MLNFontScaleAttribute`` | An `NSExpression` evaluating to an `NSNumber` value.
`MLNFontColorAttribute` | An `NSExpression` evaluating to an `UIColor`. ``MLNFontColorAttribute`` | An `NSExpression` evaluating to an `UIColor`.
*/ */
@property (strong, nonatomic, readonly) @property (strong, nonatomic, readonly)
@@ -56,22 +56,22 @@ MLN_EXPORT
The formatting attributes dictionary. The formatting attributes dictionary.
Key | Value Type Key | Value Type
--- | --- --- | ---
`MLNFontNamesAttribute` | An `NSExpression` evaluating to an `NSString` array. ``MLNFontNamesAttribute`` | An `NSExpression` evaluating to an `NSString` array.
`MLNFontScaleAttribute` | An `NSExpression` evaluating to an `NSNumber` value. ``MLNFontScaleAttribute`` | An `NSExpression` evaluating to an `NSNumber` value.
`MLNFontColorAttribute` | An `NSExpression` evaluating to an `NSColor` on macos. ``MLNFontColorAttribute`` | An `NSExpression` evaluating to an `NSColor` on macos.
*/ */
@property (strong, nonatomic, readonly) @property (strong, nonatomic, readonly)
NSDictionary<MLNAttributedExpressionKey, NSExpression *> *attributes; NSDictionary<MLNAttributedExpressionKey, NSExpression *> *attributes;
#endif #endif
/** /**
Returns an `MLNAttributedExpression` object initialized with an expression and no attribute Returns an ``MLNAttributedExpression`` object initialized with an expression and no attribute
information. information.
*/ */
- (instancetype)initWithExpression:(NSExpression *)expression; - (instancetype)initWithExpression:(NSExpression *)expression;
/** /**
Returns an `MLNAttributedExpression` object initialized with an expression and text format Returns an ``MLNAttributedExpression`` object initialized with an expression and text format
attributes. attributes.
*/ */
- (instancetype) - (instancetype)
@@ -79,7 +79,7 @@ MLN_EXPORT
attributes:(nonnull NSDictionary<MLNAttributedExpressionKey, NSExpression *> *)attrs; attributes:(nonnull NSDictionary<MLNAttributedExpressionKey, NSExpression *> *)attrs;
/** /**
Creates an `MLNAttributedExpression` object initialized with an expression and the format Creates an ``MLNAttributedExpression`` object initialized with an expression and the format
attributes for font names and font size. attributes for font names and font size.
*/ */
+ (instancetype)attributedExpression:(NSExpression *)expression + (instancetype)attributedExpression:(NSExpression *)expression
@@ -87,7 +87,7 @@ MLN_EXPORT
fontScale:(nullable NSNumber *)fontScale; fontScale:(nullable NSNumber *)fontScale;
/** /**
Creates an `MLNAttributedExpression` object initialized with an expression and the format Creates an ``MLNAttributedExpression`` object initialized with an expression and the format
attributes dictionary. attributes dictionary.
*/ */
+ (instancetype) + (instancetype)

View File

@@ -67,8 +67,8 @@ MLN_EXPORT
/** /**
Returns a copy of the current `title` formatted accordingly to `style`. Returns a copy of the current `title` formatted accordingly to `style`.
Example: If the `style` property is set to `MLNAttributionInfoStyleShort` and the Example: If the `style` property is set to ``MLNAttributionInfoStyle/MLNAttributionInfoStyleShort``
`title` property is set to `OpenStreetMap`, then this method returns `OSM`. and the `title` property is set to `OpenStreetMap`, then this method returns `OSM`.
@param style The attribution info style. @param style The attribution info style.

View File

@@ -6,14 +6,14 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNClockDirectionFormatter` class provides properly formatted descriptions The ``MLNClockDirectionFormatter`` class provides properly formatted descriptions
of headings relative to the user, known as <i>clock positions</i>. For of headings relative to the user, known as <i>clock positions</i>. For
example, a value of `90` may be formatted as “3 o’clock”, depending on the example, a value of `90` may be formatted as “3 o’clock”, depending on the
locale. locale.
Use this class to create localized heading strings when displaying directions Use this class to create localized heading strings when displaying directions
relative to the user’s current location and heading. To format a direction relative to the user’s current location and heading. To format a direction
irrespective of the user’s orientation, use `MLNCompassDirectionFormatter` irrespective of the user’s orientation, use ``MLNCompassDirectionFormatter``
instead. instead.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -37,7 +37,7 @@ MLN_EXPORT
- (NSString *)stringFromDirection:(CLLocationDirection)direction; - (NSString *)stringFromDirection:(CLLocationDirection)direction;
/** /**
This method is not supported for the `MLNDirectionFormatter` class. This method is not supported for the ``MLNClockDirectionFormatter`` class.
*/ */
- (BOOL)getObjectValue:(out id __nullable *__nullable)obj - (BOOL)getObjectValue:(out id __nullable *__nullable)obj
forString:(NSString *)string forString:(NSString *)string

View File

@@ -12,12 +12,12 @@ FOUNDATION_EXTERN MLN_EXPORT const NSUInteger MLNClusterIdentifierInvalid;
/** /**
A protocol that feature subclasses (i.e. those already conforming to A protocol that feature subclasses (i.e. those already conforming to
the `MLNFeature` protocol) conform to if they represent clusters. the ``MLNFeature`` protocol) conform to if they represent clusters.
Currently the only class that conforms to `MLNCluster` is Currently the only class that conforms to ``MLNCluster`` is
`MLNPointFeatureCluster` (a subclass of `MLNPointFeature`). ``MLNPointFeatureCluster`` (a subclass of ``MLNPointFeatureCluster``).
To check if a feature is a cluster, check conformity to `MLNCluster`, for To check if a feature is a cluster, check conformity to ``MLNCluster``, for
example: example:
```swift ```swift
@@ -32,8 +32,8 @@ FOUNDATION_EXTERN MLN_EXPORT const NSUInteger MLNClusterIdentifierInvalid;
throw ExampleError.featureIsNotACluster throw ExampleError.featureIsNotACluster
} }
// Currently the only supported class that conforms to `MLNCluster` is // Currently the only supported class that conforms to ``MLNCluster`` is
// `MLNPointFeatureCluster` // ``MLNPointFeatureCluster``
guard cluster is MLNPointFeatureCluster else { guard cluster is MLNPointFeatureCluster else {
throw ExampleError.unexpectedFeatureType throw ExampleError.unexpectedFeatureType
} }

View File

@@ -6,13 +6,13 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNCompassDirectionFormatter` class provides properly formatted The ``MLNCompassDirectionFormatter`` class provides properly formatted
descriptions of absolute headings. For example, a value of `90` may be descriptions of absolute headings. For example, a value of `90` may be
formatted as “east”, depending on the locale. formatted as “east”, depending on the locale.
Use this class to create localized heading strings when displaying directions Use this class to create localized heading strings when displaying directions
irrespective of the user’s current location. To format a direction relative to irrespective of the user’s current location. To format a direction relative to
the user’s current location, use `MLNClockDirectionFormatter` instead. the user’s current location, use ``MLNClockDirectionFormatter`` instead.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNCompassDirectionFormatter : NSFormatter @interface MLNCompassDirectionFormatter : NSFormatter
@@ -34,7 +34,7 @@ MLN_EXPORT
- (NSString *)stringFromDirection:(CLLocationDirection)direction; - (NSString *)stringFromDirection:(CLLocationDirection)direction;
/** /**
This method is not supported for the `MLNDirectionFormatter` class. This method is not supported for the ``MLNCompassDirectionFormatter`` class.
*/ */
- (BOOL)getObjectValue:(out id __nullable *__nullable)obj - (BOOL)getObjectValue:(out id __nullable *__nullable)obj
forString:(NSString *)string forString:(NSString *)string

View File

@@ -9,33 +9,33 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
An `NSNumber` object containing a Boolean value; specifies whether the shape of An `NSNumber` object containing a Boolean value; specifies whether the shape of
an `MLNComputedShapeSource` should be wrapped to accomodate coordinates with an ``MLNComputedShapeSource`` should be wrapped to accomodate coordinates with
longitudes beyond −180 and 180. The default value is `NO`. longitudes beyond −180 and 180. The default value is `NO`.
Setting this option to `YES` affects rendering performance. Setting this option to `YES` affects rendering performance.
This option is used with the `MLNComputedShapeSource` class; it is ignored when This option is used with the ``MLNComputedShapeSource`` class; it is ignored when
creating an `MLNShapeSource` object. creating an ``MLNShapeSource`` object.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionWrapsCoordinates; FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionWrapsCoordinates;
/** /**
An `NSNumber` object containing a Boolean value; specifies whether the shape of An `NSNumber` object containing a Boolean value; specifies whether the shape of
an `MLNComputedShapeSource` should be clipped at the edge of each tile. The an ``MLNComputedShapeSource`` should be clipped at the edge of each tile. The
default value is `NO`. default value is `NO`.
Setting this option to `YES` affects rendering performance. Use this option to Setting this option to `YES` affects rendering performance. Use this option to
clip `MLNPolyline`s and `MLNPolygon`s at tile boundaries without artifacts. clip ``MLNPolyline``s and ``MLNPolyline``s at tile boundaries without artifacts.
This option is used with the `MLNComputedShapeSource` class; it is ignored when This option is used with the ``MLNComputedShapeSource`` class; it is ignored when
creating an `MLNShapeSource` object. creating an ``MLNShapeSource`` object.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClipsCoordinates; FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClipsCoordinates;
FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidDatasourceException; FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidDatasourceException;
/** /**
Data source for `MLNComputedShapeSource`. This protocol defines two optional methods for fetching Data source for ``MLNComputedShapeSource``. This protocol defines two optional methods for fetching
data, one based on tile coordinates, and one based on a bounding box. Classes that implement this data, one based on tile coordinates, and one based on a bounding box. Classes that implement this
protocol must implement one, and only one of the methods. Methods on this protocol will not be protocol must implement one, and only one of the methods. Methods on this protocol will not be
called on main thread, they will be called on the caller's `requestQueue`. called on main thread, they will be called on the caller's `requestQueue`.
@@ -66,23 +66,23 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidDatasourceExceptio
@end @end
/** /**
`MLNComputedShapeSource` is a map content source that supplies vector shapes, ``MLNComputedShapeSource`` is a map content source that supplies vector shapes,
one tile at a time, to be shown on the map on demand. You implement a class one tile at a time, to be shown on the map on demand. You implement a class
conforming to the `MLNComputedShapeSourceDataSource` protocol that returns conforming to the ``MLNComputedShapeSourceDataSource`` protocol that returns
instances of `MLNShape` or `MLNFeature`, then add a computed shape source to an instances of ``MLNShape`` or ``MLNShape``, then add a computed shape source to an
`MLNStyle` object along with an `MLNVectorStyleLayer` object. The vector style ``MLNStyle`` object along with an ``MLNStyle`` object. The vector style
layer defines the appearance of any content supplied by the computed shape layer defines the appearance of any content supplied by the computed shape
source. source.
`MLNComputedShapeSource` is similar to `MLNShapeSource` but is optimized for ``MLNComputedShapeSource`` is similar to ``MLNComputedShapeSource`` but is optimized for
data sets that change dynamically or are too large to fit completely in memory. data sets that change dynamically or are too large to fit completely in memory.
It is also useful for data that is divided into tiles in a format other than It is also useful for data that is divided into tiles in a format other than
<a href="https://www.mapbox.com/vector-tiles/">Mapbox Vector Tiles</a>. For <a href="https://www.mapbox.com/vector-tiles/">Mapbox Vector Tiles</a>. For
<a href="http://geojson.org/">GeoJSON</a> data, use the `MLNShapeSource` class. <a href="http://geojson.org/">GeoJSON</a> data, use the ``MLNShapeSource`` class.
For static tiles or Mapbox Vector Tiles, use the `MLNVectorTileSource` class. For static tiles or Mapbox Vector Tiles, use the ``MLNVectorTileSource`` class.
You can add and remove sources dynamically using methods such as You can add and remove sources dynamically using methods such as
`-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. This class ``MLNStyle/addSource:`` and ``MLNStyle/sourceWithIdentifier:``. This class
cannot be represented in a style JSON file; you must add it ot the style at cannot be represented in a style JSON file; you must add it ot the style at
runtime. runtime.
*/ */
@@ -96,11 +96,11 @@ MLN_EXPORT
specification</a>. specification</a>.
This class supports the following options: This class supports the following options:
`MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, ``MLNShapeSourceOptionMinimumZoomLevel``, ``MLNShapeSourceOptionMinimumZoomLevel``,
`MLNShapeSourceOptionBuffer`, ``MLNShapeSourceOptionBuffer``,
`MLNShapeSourceOptionSimplificationTolerance`, ``MLNShapeSourceOptionSimplificationTolerance``,
`MLNShapeSourceOptionWrapsCoordinates`, and ``MLNShapeSourceOptionWrapsCoordinates``, and
`MLNShapeSourceOptionClipsCoordinates`. Shapes provided by a computed ``MLNShapeSourceOptionClipsCoordinates``. Shapes provided by a computed
shape source cannot be clustered. shape source cannot be clustered.
@param identifier A string that uniquely identifies the source. @param identifier A string that uniquely identifies the source.
@@ -117,11 +117,11 @@ MLN_EXPORT
specification</a>. specification</a>.
This class supports the following options: This class supports the following options:
`MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, ``MLNShapeSourceOptionMinimumZoomLevel``, ``MLNShapeSourceOptionMinimumZoomLevel``,
`MLNShapeSourceOptionBuffer`, ``MLNShapeSourceOptionBuffer``,
`MLNShapeSourceOptionSimplificationTolerance`, ``MLNShapeSourceOptionSimplificationTolerance``,
`MLNShapeSourceOptionWrapsCoordinates`, and ``MLNShapeSourceOptionWrapsCoordinates``, and
`MLNShapeSourceOptionClipsCoordinates`. Shapes provided by a computed shape ``MLNShapeSourceOptionClipsCoordinates``. Shapes provided by a computed shape
source cannot be clustered. source cannot be clustered.
@param identifier A string that uniquely identifies the source. @param identifier A string that uniquely identifies the source.
@@ -134,14 +134,14 @@ MLN_EXPORT
/** /**
Invalidates all the features and properties intersecting with or contained in Invalidates all the features and properties intersecting with or contained in
the specified bounds. New fetch requests will immediately be invoked on the the specified bounds. New fetch requests will immediately be invoked on the
`MLNComputedShapeSourceDataSource`. ``MLNComputedShapeSourceDataSource``.
@param bounds Coordinate bounds to invalidate. @param bounds Coordinate bounds to invalidate.
*/ */
- (void)invalidateBounds:(MLNCoordinateBounds)bounds; - (void)invalidateBounds:(MLNCoordinateBounds)bounds;
/** /**
Invalidates all the feautres and properties of a given tile. A new fetch request Invalidates all the feautres and properties of a given tile. A new fetch request
will immediately be invoked on the `MLNComputedShapeSourceDataSource`. will immediately be invoked on the ``MLNComputedShapeSourceDataSource``.
@param x Tile X coordinate. @param x Tile X coordinate.
@param y Tile Y coordinate. @param y Tile Y coordinate.
@param zoomLevel Tile zoom level. @param zoomLevel Tile zoom level.
@@ -151,7 +151,7 @@ MLN_EXPORT
/** /**
Set a new set of features for a tile. This method can be invkoed from background threads. Set a new set of features for a tile. This method can be invkoed from background threads.
For best performance, use this method only to update tiles that have already been requested For best performance, use this method only to update tiles that have already been requested
through `MLNComputedShapeSourceDataSource.` through ``MLNComputedShapeSourceDataSource/``
@param features Features for the tile. @param features Features for the tile.
@param x Tile X coordinate. @param x Tile X coordinate.
@param y Tile Y coordinate. @param y Tile Y coordinate.
@@ -163,8 +163,8 @@ MLN_EXPORT
zoomLevel:(NSUInteger)zoomLevel; zoomLevel:(NSUInteger)zoomLevel;
/** /**
An object that implements the `MLNComputedShapeSourceDataSource` protocol that will be queried for An object that implements the ``MLNComputedShapeSourceDataSource`` protocol that will be queried
tile data. for tile data.
*/ */
@property (nonatomic, weak, nullable) id<MLNComputedShapeSourceDataSource> dataSource; @property (nonatomic, weak, nullable) id<MLNComputedShapeSourceDataSource> dataSource;

View File

@@ -6,7 +6,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNCoordinateFormatter` class provides properly formatted descriptions of The ``MLNCoordinateFormatter`` class provides properly formatted descriptions of
geographic coordinate pairs. Use this class to create localized coordinate geographic coordinate pairs. Use this class to create localized coordinate
strings when displaying location information to users. strings when displaying location information to users.
*/ */
@@ -47,7 +47,7 @@ MLN_EXPORT
- (NSString *)stringFromCoordinate:(CLLocationCoordinate2D)coordinate; - (NSString *)stringFromCoordinate:(CLLocationCoordinate2D)coordinate;
/** /**
This method is not supported for the `MLNCoordinateFormatter` class. This method is not supported for the ``MLNCoordinateFormatter`` class.
*/ */
- (BOOL)getObjectValue:(out id __nullable *__nullable)obj - (BOOL)getObjectValue:(out id __nullable *__nullable)obj
forString:(NSString *)string forString:(NSString *)string

View File

@@ -20,7 +20,7 @@
class MLNCustomLayerHost; class MLNCustomLayerHost;
/** /**
An `MLNCustomStyleLayer` is a style layer that is rendered by OpenGL / Metal code that An ``MLNCustomStyleLayer`` is a style layer that is rendered by OpenGL / Metal code that
you provide. you provide.
By default, this class does nothing. You can subclass this class to provide By default, this class does nothing. You can subclass this class to provide
@@ -29,10 +29,10 @@ class MLNCustomLayerHost;
`-drawInMapView:withContext:` methods. `-drawInMapView:withContext:` methods.
You can access an existing MLNCustomStyleLayer using the You can access an existing MLNCustomStyleLayer using the
`-[MLNStyle layerWithIdentifier:]` method if you know its identifier; ``MLNStyle/layerWithIdentifier:`` method if you know its identifier;
otherwise, find it using the `MLNStyle.layers` property. You can also create a otherwise, find it using the ``MLNStyle/layers`` property. You can also create a
new MLNCustomStyleLayer and add it to the style using a method such as new MLNCustomStyleLayer and add it to the style using a method such as
`-[MLNStyle addLayer:]`. ``MLNStyle/addLayer:``.
@warning This API is undocumented and therefore unsupported. It may change at @warning This API is undocumented and therefore unsupported. It may change at
any time without notice. any time without notice.
@@ -59,8 +59,8 @@ class MLNCustomLayerHost;
Returns an MLNCustomStyleLayer style layer object initialized with the given identifier. Returns an MLNCustomStyleLayer style layer object initialized with the given identifier.
After initializing and configuring the style layer, add it to a map view’s After initializing and configuring the style layer, add it to a map view’s
style using the `-[MLNStyle addLayer:]` or style using the ``MLNStyle/addLayer:`` or
`-[MLNStyle insertLayer:belowLayer:]` method. ``MLNStyle/insertLayer:belowLayer:`` method.
@param identifier A string that uniquely identifies the layer in the style to @param identifier A string that uniquely identifies the layer in the style to
which it is added. which it is added.

View File

@@ -5,7 +5,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNDefaultStyle` defines the predefined vendor style The ``MLNDefaultStyle`` defines the predefined vendor style
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNDefaultStyle : NSObject @interface MLNDefaultStyle : NSObject

View File

@@ -6,7 +6,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
`MLNDistanceFormatter` implements a formatter object meant to be used for ``MLNDistanceFormatter`` implements a formatter object meant to be used for
geographic distances. The user’s current locale will be used by default geographic distances. The user’s current locale will be used by default
but it can be overriden by changing the locale property of the numberFormatter. but it can be overriden by changing the locale property of the numberFormatter.
*/ */

View File

@@ -11,31 +11,31 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNFeature` protocol is used to provide details about geographic features The ``MLNFeature`` protocol is used to provide details about geographic features
contained in an `MLNShapeSource` or `MLNVectorTileSource` object. Each concrete contained in an ``MLNShapeSource`` or ``MLNVectorTileSource`` object. Each concrete
subclass of `MLNShape` in turn has a subclass that conforms to this protocol. A subclass of ``MLNShape`` in turn has a subclass that conforms to this protocol. A
feature object associates a shape with an optional identifier and attributes. feature object associates a shape with an optional identifier and attributes.
You can add custom data to display on the map by creating feature objects and You can add custom data to display on the map by creating feature objects and
adding them to an `MLNShapeSource` using the adding them to an ``MLNShapeSource`` using the
`-[MLNShapeSource initWithIdentifier:shape:options:]` method or ``MLNShapeSource/initWithIdentifier:shape:options:`` method or
`MLNShapeSource.shape` property. ``MLNShapeSource/shape`` property.
In addition to adding data to the map, you can also extract data from the map: In addition to adding data to the map, you can also extract data from the map:
`-[MLNMapView visibleFeaturesAtPoint:]` and related methods return feature ``MLNMapView/visibleFeaturesAtPoint:`` and related methods return feature
objects that correspond to features in the source. This enables you to inspect objects that correspond to features in the source. This enables you to inspect
the properties of features in vector tiles loaded by `MLNVectorTileSource` the properties of features in vector tiles loaded by ``MLNVectorTileSource``
objects. You also reuse these feature objects as overlay annotations. objects. You also reuse these feature objects as overlay annotations.
While it is possible to add `MLNFeature`-conforming objects to the map as While it is possible to add ``MLNFeature``-conforming objects to the map as
annotations using `-[MLNMapView addAnnotations:]` and related methods, doing so annotations using ``MLNMapView/addAnnotations:`` and related methods, doing so
has trade-offs: has trade-offs:
- Features added as annotations will not have `identifier` or `attributes` - Features added as annotations will not have ``identifier`` or ``attributes``
properties when used with feature querying. properties when used with feature querying.
- Features added as annotations become interactive. Taps and selection can be - Features added as annotations become interactive. Taps and selection can be
handled in `-[MLNMapViewDelegate mapView:didSelectAnnotation:]`. handled in ``MLNMapViewDelegate/mapView:didSelectAnnotation:``.
*/ */
@protocol MLNFeature <MLNAnnotation> @protocol MLNFeature <MLNAnnotation>
@@ -43,12 +43,12 @@ NS_ASSUME_NONNULL_BEGIN
An object that uniquely identifies the feature in its containing content An object that uniquely identifies the feature in its containing content
source. source.
You can configure an `MLNVectorStyleLayer` object to include or exclude a You can configure an ``MLNVectorStyleLayer`` object to include or exclude a
specific feature in an `MLNShapeSource` or `MLNVectorTileSource`. In the specific feature in an ``MLNShapeSource`` or ``MLNVectorTileSource``. In the
`MLNVectorStyleLayer.predicate` property, compare the special `$id` attribute ``MLNVectorStyleLayer/predicate`` property, compare the special `$id` attribute
to the feature’s identifier. to the feature’s identifier.
In vector tiles loaded by `MLNVectorTileSource` objects, the identifier In vector tiles loaded by ``MLNVectorTileSource`` objects, the identifier
corresponds to the corresponds to the
<a href="https://github.com/mapbox/vector-tile-spec/tree/master/2.1#42-features">feature <a href="https://github.com/mapbox/vector-tile-spec/tree/master/2.1#42-features">feature
identifier</a> identifier</a>
@@ -57,27 +57,16 @@ NS_ASSUME_NONNULL_BEGIN
floating-point number, or string. These data types are mapped to instances of floating-point number, or string. These data types are mapped to instances of
the following Foundation classes: the following Foundation classes:
<table> | In the tile source | This property |
<thead> |---------------------------|-------------------------------------------------------------------------------|
<tr><th>In the tile source</th><th>This property</th></tr> | Integer | `NSNumber` (use the `unsignedLongLongValue` or `longLongValue`
</thead> property) | | Floating-point number | `NSNumber` (use the `doubleValue` property) | |
<tbody> String | `NSString` |
<tr><td>Integer</td> <td><code>NSNumber</code> (use the
<code>unsignedLongLongValue</code> or <code>longLongValue</code> property)</td></tr>
<tr><td>Floating-point number</td> <td><code>NSNumber</code> (use the <code>doubleValue</code>
property)</td></tr> <tr><td>String</td> <td><code>NSString</code></td></tr>
</tbody>
</table>
For details about the identifiers used in most Mapbox-provided styles, consult The identifier should be set before adding the feature to an ``MLNShapeSource``
the
<a href="https://www.mapbox.com/vector-tiles/mapbox-streets/">Mapbox Streets</a>
layer reference.
The identifier should be set before adding the feature to an `MLNShapeSource`
object; setting it afterwards has no effect on the map’s contents. While it is object; setting it afterwards has no effect on the map’s contents. While it is
possible to change this value on feature instances obtained from possible to change this value on feature instances obtained from
`-[MLNMapView visibleFeaturesAtPoint:]` and related methods, doing so likewise ``MLNMapView/visibleFeaturesAtPoint:`` and related methods, doing so likewise
has no effect on the map’s contents. has no effect on the map’s contents.
*/ */
@property (nonatomic, copy, nullable) id identifier; @property (nonatomic, copy, nullable) id identifier;
@@ -85,71 +74,59 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
A dictionary of attributes for this feature. A dictionary of attributes for this feature.
You can configure an `MLNVectorStyleLayer` object to include or exclude a You can configure an ``MLNVectorStyleLayer`` object to include or exclude a
specific feature in an `MLNShapeSource` or `MLNVectorTileSource`. In the specific feature in an ``MLNShapeSource`` or ``MLNVectorTileSource``. In the
`MLNVectorStyleLayer.predicate` property, compare a key of the attribute ``MLNVectorStyleLayer/predicate`` property, compare a key of the attribute
dictionary to the value you want to include. For example, if you want an dictionary to the value you want to include. For example, if you want an
`MLNLineStyleLayer` object to display only important features, you might assign ``MLNLineStyleLayer`` object to display only important features, you might assign
a value above 50 to the important features’ `importance` attribute, then set a value above 50 to the important features’ `importance` attribute, then set
`MLNVectorStyleLayer.predicate` to an `NSPredicate` with the format ``MLNVectorStyleLayer/predicate`` to an
[`NSPredicate`](https://developer.apple.com/documentation/foundation/nspredicate) with the format
`importance > 50`. `importance > 50`.
You can also configure many layout and paint attributes of an `MLNStyleLayer` You can also configure many layout and paint attributes of an ``MLNStyleLayer``
object to match the value of an attribute in this dictionary whenever it object to match the value of an attribute in this dictionary whenever it
renders this feature. For example, if you display features in an renders this feature. For example, if you display features in an
`MLNShapeSource` using an `MLNCircleStyleLayer`, you can assign a `halfway` ``MLNShapeSource`` using an ``MLNCircleStyleLayer``, you can assign a `halfway`
attribute to each of the source’s features, then set attribute to each of the source’s features, then set
`MLNCircleStyleLayer.circleRadius` to an expression for the key path `halfway`. ``MLNCircleStyleLayer/circleRadius`` to an expression for the key path `halfway`.
The `MLNSymbolStyleLayer.text` and `MLNSymbolStyleLayer.iconImageName` The ``MLNSymbolStyleLayer/text`` and ``MLNSymbolStyleLayer/iconImageName``
properties allow you to use attributes yet another way. For example, to label properties allow you to use attributes yet another way. For example, to label
features in an `MLNShapeSource` object by their names, you can assign a `name` features in an ``MLNShapeSource`` object by their names, you can assign a `name`
attribute to each of the source’s features, then set attribute to each of the source’s features, then set
`MLNSymbolStyleLayer.text` to an expression for the constant string value ``MLNSymbolStyleLayer/text`` to an expression for the constant string value
`{name}`. See the `{name}`. See the
<a href="../predicates-and-expressions.html">Predicates and Expressions</a> <a href="../predicates-and-expressions.html">Predicates and Expressions</a>
guide for more information about expressions. guide for more information about expressions.
In vector tiles loaded by `MLNVectorTileSource` objects, the keys and values of In vector tiles loaded by ``MLNVectorTileSource`` objects, the keys and values of
each feature’s attribute dictionary are determined by the source. Each each feature’s attribute dictionary are determined by the source. Each
attribute name is a string, while each attribute value may be a null value, attribute name is a string, while each attribute value may be a null value,
Boolean value, integer, floating-point number, or string. These data types are Boolean value, integer, floating-point number, or string. These data types are
mapped to instances of the following Foundation classes: mapped to instances of the following Foundation classes:
<table> | In the tile source | In this dictionary |
<thead> |---------------------------|-------------------------------------------------------------------------------|
<tr><th>In the tile source</th><th>In this dictionary</th></tr> | Null | `NSNull` | | Boolean | `NSNumber` (use the
</thead> `boolValue` property) | | Integer |
<tbody> `NSNumber` (use the `unsignedLongLongValue` or `longLongValue` property) | | Floating-point
<tr><td>Null</td> <td><code>NSNull</code></td></tr> number | `NSNumber` (use the `doubleValue` property) | |
<tr><td>Boolean</td> <td><code>NSNumber</code> (use the <code>boolValue</code> String | `NSString` |
property)</td></tr> <tr><td>Integer</td> <td><code>NSNumber</code> (use the
<code>unsignedLongLongValue</code> or <code>longLongValue</code> property)</td></tr>
<tr><td>Floating-point number</td> <td><code>NSNumber</code> (use the <code>doubleValue</code>
property)</td></tr> <tr><td>String</td> <td><code>NSString</code></td></tr>
</tbody>
</table>
For details about the attribute names and values found in Mapbox-provided When adding a feature to an ``MLNShapeSource``, use the same Foundation types
vector tile sources, consult the
<a href="https://www.mapbox.com/vector-tiles/mapbox-streets/">Mapbox Streets</a>
and
<a href="https://www.mapbox.com/vector-tiles/mapbox-terrain/">Mapbox Terrain</a>
layer references.
When adding a feature to an `MLNShapeSource`, use the same Foundation types
listed above for each attribute value. In addition to the Foundation types, you listed above for each attribute value. In addition to the Foundation types, you
may also set an attribute to an `NSColor` (macOS) or `UIColor` (iOS), which may also set an attribute to an `NSColor` (macOS) or `UIColor` (iOS), which
will be converted into its will be converted into its
<a href="https://maplibre.org/maplibre-style-spec/types/#color">CSS string representation</a> <a href="https://maplibre.org/maplibre-style-spec/types/#color">CSS string representation</a>
when the feature is added to an `MLNShapeSource`. This can be convenient when when the feature is added to an ``MLNShapeSource``. This can be convenient when
using the attribute to supply a value for a color-typed layout or paint using the attribute to supply a value for a color-typed layout or paint
attribute via a key path expression. attribute via a key path expression.
Note that while it is possible to change this value on feature Note that while it is possible to change this value on feature
instances obtained from `-[MLNMapView visibleFeaturesAtPoint:]` and related instances obtained from ``MLNMapView/visibleFeaturesAtPoint:`` and related
methods, there will be no effect on the map. Setting this value can be useful methods, there will be no effect on the map. Setting this value can be useful
when the feature instance is used to initialize an `MLNShapeSource` and that when the feature instance is used to initialize an ``MLNShapeSource`` and that
source is added to the map and styled. source is added to the map and styled.
*/ */
@property (nonatomic, copy) NSDictionary<NSString *, id> *attributes; @property (nonatomic, copy) NSDictionary<NSString *, id> *attributes;
@@ -157,26 +134,26 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
Returns the feature attribute for the given attribute name. Returns the feature attribute for the given attribute name.
See the `attributes` property’s documentation for details on keys and values See the ``attributes`` property’s documentation for details on keys and values
associated with this method. associated with this method.
*/ */
- (nullable id)attributeForKey:(NSString *)key; - (nullable id)attributeForKey:(NSString *)key;
/** /**
Returns a dictionary that can be serialized as a GeoJSON Feature representation Returns a dictionary that can be serialized as a GeoJSON Feature representation
of an instance of an `MLNFeature` subclass. of an instance of an ``MLNFeature`` subclass.
The dictionary includes a `geometry` key corresponding to the receiver’s The dictionary includes a `geometry` key corresponding to the receiver’s
underlying geometry data, a `properties` key corresponding to the receiver’s underlying geometry data, a `properties` key corresponding to the receiver’s
`attributes` property, and an `id` key corresponding to the receiver’s `attributes` property, and an `id` key corresponding to the receiver’s
`identifier` property. ``identifier` property.
*/ */
- (NSDictionary<NSString *, id> *)geoJSONDictionary; - (NSDictionary<NSString *, id> *)geoJSONDictionary;
@end @end
/** /**
An `MLNEmptyFeature` object associates an empty shape with an optional An ``MLNEmptyFeature`` object associates an empty shape with an optional
identifier and attributes. identifier and attributes.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -184,22 +161,21 @@ MLN_EXPORT
@end @end
/** /**
An `MLNPointFeature` object associates a point shape with an optional An ``MLNPointFeature`` object associates a point shape with an optional
identifier and attributes. identifier and attributes.
#### Related examples #### Related examples
TODO: Dynamically style interactive points, learn how to initialize - <doc:WebAPIDataExample>
`MLNPointFeature` objects and add them to your map.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNPointFeature : MLNPointAnnotation <MLNFeature> @interface MLNPointFeature : MLNPointAnnotation <MLNFeature>
@end @end
/** /**
An `MLNPointFeatureCluster` object associates a point shape (with an optional An ``MLNPointFeatureCluster`` object associates a point shape (with an optional
identifier and attributes) and represents a point cluster. identifier and attributes) and represents a point cluster.
@see `MLNCluster` @see ``MLNCluster``
#### Related examples #### Related examples
TODO: Clustering point data, learn how to initialize TODO: Clustering point data, learn how to initialize
@@ -210,7 +186,7 @@ MLN_EXPORT
@end @end
/** /**
An `MLNPolylineFeature` object associates a polyline shape with an optional An ``MLNPolylineFeature`` object associates a polyline shape with an optional
identifier and attributes. identifier and attributes.
A polyline feature is known as a A polyline feature is known as a
@@ -218,15 +194,14 @@ MLN_EXPORT
feature in GeoJSON. feature in GeoJSON.
#### Related examples #### Related examples
TODO: Add a line annotation from GeoJSON, learn how to initialize an - <doc:AnimatedLineExample>
`MLNPolylineFeature` and add it to an `MLNMapView` object.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNPolylineFeature : MLNPolyline <MLNFeature> @interface MLNPolylineFeature : MLNPolyline <MLNFeature>
@end @end
/** /**
An `MLNPolygonFeature` object associates a polygon shape with an optional An ``MLNPolygonFeature`` object associates a polygon shape with an optional
identifier and attributes. identifier and attributes.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -234,7 +209,7 @@ MLN_EXPORT
@end @end
/** /**
An `MLNPointCollectionFeature` object associates a point collection with an An ``MLNPointCollectionFeature`` object associates a point collection with an
optional identifier and attributes. optional identifier and attributes.
A point collection feature is known as a A point collection feature is known as a
@@ -249,7 +224,7 @@ MLN_EXPORT
@compatibility_alias MLNMultiPointFeature MLNPointCollectionFeature; @compatibility_alias MLNMultiPointFeature MLNPointCollectionFeature;
/** /**
An `MLNMultiPolylineFeature` object associates a multipolyline shape with an An ``MLNMultiPolylineFeature`` object associates a multipolyline shape with an
optional identifier and attributes. optional identifier and attributes.
A multipolyline feature is known as a A multipolyline feature is known as a
@@ -261,7 +236,7 @@ MLN_EXPORT
@end @end
/** /**
An `MLNMultiPolygonFeature` object associates a multipolygon shape with an An ``MLNMultiPolygonFeature`` object associates a multipolygon shape with an
optional identifier and attributes. optional identifier and attributes.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -269,14 +244,14 @@ MLN_EXPORT
@end @end
/** /**
An `MLNShapeCollectionFeature` object associates a shape collection with an An ``MLNShapeCollectionFeature`` object associates a shape collection with an
optional identifier and attributes. optional identifier and attributes.
`MLNShapeCollectionFeature` is most commonly used to add multiple shapes to a ``MLNShapeCollectionFeature`` is most commonly used to add multiple shapes to a
single `MLNShapeSource`. Configure the appearance of an `MLNSource`’s shape single ``MLNShapeSource``. Configure the appearance of an ``MLNSource``’s shape
collection collectively using an `MLNSymbolStyleLayer` object, or use multiple collection collectively using an ``MLNSymbolStyleLayer`` object, or use multiple
instances of `MLNCircleStyleLayer`, `MLNFillStyleLayer`, and instances of ``MLNCircleStyleLayer``, ``MLNFillStyleLayer``, and
`MLNLineStyleLayer` to configure the appearance of each kind of shape inside ``MLNLineStyleLayer`` to configure the appearance of each kind of shape inside
the collection. the collection.
A shape collection feature is known as a A shape collection feature is known as a
@@ -285,7 +260,7 @@ MLN_EXPORT
#### Related examples #### Related examples
TODO: Add multiple shapes from a single shape source, learn how to TODO: Add multiple shapes from a single shape source, learn how to
add shape data to your map using an `MLNShapeCollectionFeature` object. add shape data to your map using an ``MLNShapeCollectionFeature`` object.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNShapeCollectionFeature : MLNShapeCollection <MLNFeature> @interface MLNShapeCollectionFeature : MLNShapeCollection <MLNFeature>

View File

@@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
Returns an array of `MLNFeature` objects converted from the given vector of Returns an array of ``MLNFeature`` objects converted from the given vector of
vector tile features. vector tile features.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -17,7 +17,7 @@ NSArray<MLNShape<MLNFeature> *> *MLNFeaturesFromMBGLFeatures(
const std::vector<mbgl::Feature> &features); const std::vector<mbgl::Feature> &features);
/** /**
Returns an array of `MLNFeature` objects converted from the given vector of Returns an array of ``MLNFeature`` objects converted from the given vector of
vector tile features. vector tile features.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -25,13 +25,13 @@ NSArray<MLNShape<MLNFeature> *> *MLNFeaturesFromMBGLFeatures(
const std::vector<mbgl::GeoJSONFeature> &features); const std::vector<mbgl::GeoJSONFeature> &features);
/** /**
Returns an `MLNFeature` object converted from the given mbgl::GeoJSONFeature Returns an ``MLNFeature`` object converted from the given mbgl::GeoJSONFeature
*/ */
MLN_EXPORT MLN_EXPORT
id<MLNFeature> MLNFeatureFromMBGLFeature(const mbgl::GeoJSONFeature &feature); id<MLNFeature> MLNFeatureFromMBGLFeature(const mbgl::GeoJSONFeature &feature);
/** /**
Returns an `MLNShape` representing the given geojson. The shape can be Returns an ``MLNShape`` representing the given geojson. The shape can be
a feature, a collection of features, or a geometry. a feature, a collection of features, or a geometry.
*/ */
MLNShape *MLNShapeFromGeoJSON(const mapbox::geojson::geojson &geojson); MLNShape *MLNShapeFromGeoJSON(const mapbox::geojson::geojson &geojson);
@@ -45,7 +45,7 @@ mbgl::GeoJSONFeature mbglFeature(mbgl::GeoJSONFeature feature, id identifier,
NSDictionary *attributes); NSDictionary *attributes);
/** /**
Returns an `NSDictionary` representation of an `MLNFeature`. Returns an `NSDictionary` representation of an ``MLNFeature``.
*/ */
NSDictionary<NSString *, id> *NSDictionaryFeatureForGeometry(NSDictionary *geometry, NSDictionary<NSString *, id> *NSDictionaryFeatureForGeometry(NSDictionary *geometry,
NSDictionary *attributes, NSDictionary *attributes,

View File

@@ -8,13 +8,13 @@ NS_ASSUME_NONNULL_BEGIN
@class MLNSource; @class MLNSource;
/** /**
`MLNForegroundStyleLayer` is an abstract superclass for style layers whose ``MLNForegroundStyleLayer`` is an abstract superclass for style layers whose
content is defined by an `MLNSource` object. content is defined by an ``MLNSource`` object.
Create instances of `MLNRasterStyleLayer`, `MLNHillshadeStyleLayer`, and the Create instances of ``MLNRasterStyleLayer``, ``MLNRasterStyleLayer``, and the
concrete subclasses of `MLNVectorStyleLayer` in order to use concrete subclasses of ``MLNVectorStyleLayer`` in order to use
`MLNForegroundStyleLayer`'s methods. Do not create instances of ``MLNForegroundStyleLayer``'s methods. Do not create instances of
`MLNForegroundStyleLayer` directly, and do not create your own subclasses of ``MLNForegroundStyleLayer`` directly, and do not create your own subclasses of
this class. this class.
*/ */
MLN_EXPORT MLN_EXPORT

View File

@@ -6,11 +6,11 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** Defines the area spanned by an `MLNCoordinateBounds`. */ /** Defines the area spanned by an ``MLNCoordinateBounds``. */
typedef struct __attribute__((objc_boxable)) MLNCoordinateSpan { typedef struct __attribute__((objc_boxable)) MLNCoordinateSpan {
/** Latitudes spanned by an `MLNCoordinateBounds`. */ /** Latitudes spanned by an ``MLNCoordinateBounds``. */
CLLocationDegrees latitudeDelta; CLLocationDegrees latitudeDelta;
/** Longitudes spanned by an `MLNCoordinateBounds`. */ /** Longitudes spanned by an ``MLNCoordinateBounds``. */
CLLocationDegrees longitudeDelta; CLLocationDegrees longitudeDelta;
} MLNCoordinateSpan; } MLNCoordinateSpan;
@@ -33,7 +33,7 @@ typedef struct MLNMatrix4 {
} MLNMatrix4; } MLNMatrix4;
/** /**
Creates a new `MLNCoordinateSpan` from the given latitudinal and longitudinal Creates a new ``MLNCoordinateSpan`` from the given latitudinal and longitudinal
deltas. deltas.
*/ */
NS_INLINE MLNCoordinateSpan MLNCoordinateSpanMake(CLLocationDegrees latitudeDelta, NS_INLINE MLNCoordinateSpan MLNCoordinateSpanMake(CLLocationDegrees latitudeDelta,
@@ -45,7 +45,7 @@ NS_INLINE MLNCoordinateSpan MLNCoordinateSpanMake(CLLocationDegrees latitudeDelt
} }
/** /**
Creates a new `MLNMapPoint` from the given X and Y coordinates, and zoom level. Creates a new ``MLNMapPoint`` from the given X and Y coordinates, and zoom level.
*/ */
NS_INLINE MLNMapPoint MLNMapPointMake(CGFloat x, CGFloat y, CGFloat zoomLevel) { NS_INLINE MLNMapPoint MLNMapPointMake(CGFloat x, CGFloat y, CGFloat zoomLevel) {
MLNMapPoint point; MLNMapPoint point;
@@ -78,7 +78,7 @@ typedef struct __attribute__((objc_boxable)) MLNCoordinateBounds {
/** /**
A quadrilateral area as measured on a two-dimensional map projection. A quadrilateral area as measured on a two-dimensional map projection.
`MLNCoordinateQuad` differs from `MLNCoordinateBounds` in that it allows ``MLNCoordinateQuad`` differs from ``MLNCoordinateQuad`` in that it allows
representation of non-axis aligned bounds and non-rectangular quadrilaterals. representation of non-axis aligned bounds and non-rectangular quadrilaterals.
The coordinates are described in counter clockwise order from top left. The coordinates are described in counter clockwise order from top left.
*/ */
@@ -94,7 +94,7 @@ typedef struct MLNCoordinateQuad {
} MLNCoordinateQuad; } MLNCoordinateQuad;
/** /**
Creates a new `MLNCoordinateBounds` structure from the given southwest and Creates a new ``MLNCoordinateBounds`` structure from the given southwest and
northeast coordinates. northeast coordinates.
*/ */
NS_INLINE MLNCoordinateBounds MLNCoordinateBoundsMake(CLLocationCoordinate2D sw, NS_INLINE MLNCoordinateBounds MLNCoordinateBoundsMake(CLLocationCoordinate2D sw,
@@ -106,7 +106,7 @@ NS_INLINE MLNCoordinateBounds MLNCoordinateBoundsMake(CLLocationCoordinate2D sw,
} }
/** /**
Creates a new `MLNCoordinateQuad` structure from the given top left, Creates a new ``MLNCoordinateQuad`` structure from the given top left,
bottom left, bottom right, and top right coordinates. bottom left, bottom right, and top right coordinates.
*/ */
NS_INLINE MLNCoordinateQuad MLNCoordinateQuadMake(CLLocationCoordinate2D topLeft, NS_INLINE MLNCoordinateQuad MLNCoordinateQuadMake(CLLocationCoordinate2D topLeft,
@@ -122,7 +122,7 @@ NS_INLINE MLNCoordinateQuad MLNCoordinateQuadMake(CLLocationCoordinate2D topLeft
} }
/** /**
Creates a new `MLNCoordinateQuad` structure from the given `MLNCoordinateBounds`. Creates a new ``MLNCoordinateQuad`` structure from the given ``MLNCoordinateQuad``.
The returned quad uses the bounds' northeast coordinate as the top right, and the The returned quad uses the bounds' northeast coordinate as the top right, and the
southwest coordinate at the bottom left. southwest coordinate at the bottom left.
*/ */
@@ -156,7 +156,7 @@ NS_INLINE BOOL MLNCoordinateBoundsIntersectsCoordinateBounds(MLNCoordinateBounds
#### Related examples #### Related examples
TODO: Restrict map panning to an area, learn how to use TODO: Restrict map panning to an area, learn how to use
`MLNCoordinateInCoordinateBounds` to determine if a point is within, or ``MLNCoordinateInCoordinateBounds`` to determine if a point is within, or
intersects, a given bounding box. intersects, a given bounding box.
*/ */
NS_INLINE BOOL MLNCoordinateInCoordinateBounds(CLLocationCoordinate2D coordinate, NS_INLINE BOOL MLNCoordinateInCoordinateBounds(CLLocationCoordinate2D coordinate,
@@ -189,7 +189,7 @@ NS_INLINE MLNCoordinateBounds MLNCoordinateBoundsOffset(MLNCoordinateBounds boun
/** /**
Returns `YES` if the coordinate bounds covers no area. Returns `YES` if the coordinate bounds covers no area.
@note A bounds may be empty but have a non-zero coordinate span (e.g., when its > Note: 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). northeast point lies due north of its southwest point).
*/ */
NS_INLINE BOOL MLNCoordinateBoundsIsEmpty(MLNCoordinateBounds bounds) { NS_INLINE BOOL MLNCoordinateBoundsIsEmpty(MLNCoordinateBounds bounds) {

View File

@@ -8,27 +8,27 @@ NS_ASSUME_NONNULL_BEGIN
MLN_EXPORT MLN_EXPORT
/** /**
`MLNImageSource` is a content source that is used for a georeferenced raster ``MLNImageSource`` is a content source that is used for a georeferenced raster
image to be shown on the map. The georeferenced image scales and rotates as the image to be shown on the map. The georeferenced image scales and rotates as the
user zooms and rotates the map. Images may also be used as icons or patterns user zooms and rotates the map. Images may also be used as icons or patterns
in a style layer. To register an image for use as an icon or pattern, in a style layer. To register an image for use as an icon or pattern,
use the `-[MLNStyle setImage:forName:]` method. To configure a point use the ``MLNStyle/setImage:forName:`` method. To configure a point
annotation’s image, use the `MLNAnnotationImage` class. annotation’s image, use the ``MLNAnnotationImage`` class.
The geographic location of the raster image content, supplied with The geographic location of the raster image content, supplied with
`MLNCoordinateQuad`, can be non-axis aligned. ``MLNCoordinateQuad``, can be non-axis aligned.
`MLNImageSource` supports raster content from `NSURL`, `NSImage` (macOS), or ``MLNImageSource`` supports raster content from `NSURL`, `NSImage` (macOS), or
`UIImage` (iOS). `UIImage` (iOS).
An image source is added to an `MLNStyle` object along with one or more An image source is added to an ``MLNStyle`` object along with one or more
`MLNRasterStyleLayer` objects. Use a raster style layer to control the ``MLNRasterStyleLayer`` objects. Use a raster style layer to control the
appearance of content supplied by the image source. appearance of content supplied by the image source.
Each Each
<a href="https://maplibre.org/maplibre-style-spec/#sources-image"><code>image</code></a> <a href="https://maplibre.org/maplibre-style-spec/#sources-image"><code>image</code></a>
source defined by the style JSON file is represented at runtime by an source defined by the style JSON file is represented at runtime by an
`MLNImageSource` object that you can use to initialize new style layers. You ``MLNImageSource`` object that you can use to initialize new style layers. You
can also add and remove sources dynamically using methods such as can also add and remove sources dynamically using methods such as
`-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. ``MLNStyle/addSource:`` and ``MLNStyle/sourceWithIdentifier:``.
### Example ### Example
@@ -43,7 +43,7 @@ MLN_EXPORT
``` ```
#### Related examples #### Related examples
TODO: Add an image, learn how to add an image to your map using `MLNImageSource`. TODO: Add an image, learn how to add an image to your map using ``MLNImageSource``.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNImageSource : MLNSource @interface MLNImageSource : MLNSource

View File

@@ -36,8 +36,8 @@ typedef NS_ENUM(NSUInteger, MLNLight<%- camelize(property.name) %>) {
typedef struct __attribute__((objc_boxable)) MLNSphericalPosition { typedef struct __attribute__((objc_boxable)) MLNSphericalPosition {
/** Distance from the center of the base of an object to its light. */ /** Distance from the center of the base of an object to its light. */
CGFloat radial; CGFloat radial;
/** Position of the light relative to 0° (0° when `MLNLight.anchor` is set to viewport corresponds /** Position of the light relative to 0° (0° when ``MLNLight/anchor`` is set to viewport corresponds
to the top of the viewport, or 0° when `MLNLight.anchor` is set to map corresponds to due north, to the top of the viewport, or 0° when ``MLNLight/anchor`` is set to map corresponds to due north,
and degrees proceed clockwise). */ and degrees proceed clockwise). */
CLLocationDirection azimuthal; CLLocationDirection azimuthal;
/** Indicates the height of the light (from 0°, directly above, to 180°, directly below). */ /** Indicates the height of the light (from 0°, directly above, to 180°, directly below). */
@@ -45,13 +45,13 @@ typedef struct __attribute__((objc_boxable)) MLNSphericalPosition {
} MLNSphericalPosition; } MLNSphericalPosition;
/** /**
Creates a new `MLNSphericalPosition` from the given radial, azimuthal, polar. Creates a new ``MLNSphericalPosition`` from the given radial, azimuthal, polar.
@param radial The radial coordinate. @param radial The radial coordinate.
@param azimuthal The azimuthal angle. @param azimuthal The azimuthal angle.
@param polar The polar angle. @param polar The polar angle.
@return Returns a `MLNSphericalPosition` struct containing the position attributes. @return Returns a ``MLNSphericalPosition`` struct containing the position attributes.
*/ */
NS_INLINE MLNSphericalPosition MLNSphericalPositionMake(CGFloat radial, CLLocationDirection azimuthal, CLLocationDirection polar) { NS_INLINE MLNSphericalPosition MLNSphericalPositionMake(CGFloat radial, CLLocationDirection azimuthal, CLLocationDirection polar) {
MLNSphericalPosition position; MLNSphericalPosition position;

View File

@@ -11,12 +11,12 @@ class Light;
@interface MLNLight (Private) @interface MLNLight (Private)
/** /**
Initializes and returns a `MLNLight` associated with a style's light. Initializes and returns a ``MLNLight`` associated with a style's light.
*/ */
- (instancetype)initWithMBGLLight:(const mbgl::style::Light *)mbglLight; - (instancetype)initWithMBGLLight:(const mbgl::style::Light *)mbglLight;
/** /**
Returns an `mbgl::style::Light` representation of the `MLNLight`. Returns an `mbgl::style::Light` representation of the ``MLNLight``.
*/ */
- (mbgl::style::Light)mbglLight; - (mbgl::style::Light)mbglLight;

View File

@@ -6,15 +6,15 @@ NS_ASSUME_NONNULL_BEGIN
@protocol MLNLocationManagerDelegate; @protocol MLNLocationManagerDelegate;
/** /**
The `MLNLocationManager` protocol defines a set of methods that a class must The ``MLNLocationManager`` protocol defines a set of methods that a class must
implement in order to serve as the location manager of an `MLNMapView`. A location implement in order to serve as the location manager of an ``MLNMapView``. A location
manager is responsible for notifying the map view about location-related events, manager is responsible for notifying the map view about location-related events,
such as a change in the user’s location. This protocol is similar to the such as a change in the user’s location. This protocol is similar to the
Core Location framework’s `CLLocationManager` class, but your implementation Core Location framework’s `CLLocationManager` class, but your implementation
does not need to be based on `CLLocationManager`. does not need to be based on `CLLocationManager`.
To receive location updates from an object that conforms to the `MLNLocationManager` To receive location updates from an object that conforms to the ``MLNLocationManager``
protocol, use the optional methods available in the `MLNLocationManagerDelegate` protocol. protocol, use the optional methods available in the ``MLNLocationManagerDelegate`` protocol.
*/ */
@protocol MLNLocationManager <NSObject> @protocol MLNLocationManager <NSObject>
@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
Specifies the minimum distance (measured in meters) a device must move horizontally Specifies the minimum distance (measured in meters) a device must move horizontally
before a location update is generated. before a location update is generated.
The default value of this property is `kCLDistanceFilterNone` when `MLNMapView` uses its The default value of this property is `kCLDistanceFilterNone` when ``MLNMapView`` uses its
default location manager. default location manager.
@see `CLLocationManager.distanceFilter` @see `CLLocationManager.distanceFilter`
@@ -42,10 +42,10 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
Specifies the accuracy of the location data. Specifies the accuracy of the location data.
The default value is `kCLLocationAccuracyBest` when `MLNMapView` uses its The default value is `kCLLocationAccuracyBest` when ``MLNMapView`` uses its
default location manager. default location manager.
@note Determining a location with greater accuracy requires more time and more power. > Note: Determining a location with greater accuracy requires more time and more power.
@see `CLLocationManager.desiredAccuracy` @see `CLLocationManager.desiredAccuracy`
*/ */
@@ -62,9 +62,9 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
Specifies the level of location accuracy the Maps SDK has permission to use. Specifies the level of location accuracy the Maps SDK has permission to use.
@note If the value of this property is `CLAccuracyAuthorizationFullAccuracy`, you can set the > Note: If the value of this property is `CLAccuracyAuthorizationFullAccuracy`, you can set the
`MLNLocationManager.desiredAccuracy` property to any value. If the value is ``MLNLocationManager/desiredAccuracy`` property to any value. If the value is
`CLAccuracyAuthorizationReducedAccuracy`, setting `MLNLocationManager.desiredAccuracy` to a value `CLAccuracyAuthorizationReducedAccuracy`, setting ``MLNLocationManager/desiredAccuracy`` to a value
other than` kCLLocationAccuracyReduced` has no effect on the location information. other than` kCLLocationAccuracyReduced` has no effect on the location information.
*/ */
- (CLAccuracyAuthorization)accuracyAuthorization API_AVAILABLE(ios(14)); - (CLAccuracyAuthorization)accuracyAuthorization API_AVAILABLE(ios(14));
@@ -76,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN
The location manager uses this property as a cue to determine when location updates The location manager uses this property as a cue to determine when location updates
may be automatically paused. may be automatically paused.
The default value is `CLActivityTypeOther` when `MLNMapView` uses its The default value is `CLActivityTypeOther` when ``MLNMapView`` uses its
default location manager. default location manager.
@see `CLLocationManager.activityType` @see `CLLocationManager.activityType`
@@ -95,7 +95,7 @@ NS_ASSUME_NONNULL_BEGIN
Requests the user's permission to temporarily use location update services Requests the user's permission to temporarily use location update services
with full accuracy. with full accuracy.
@note If the user turned off location accuracy you may use this method to > Note: If the user turned off location accuracy you may use this method to
request full accuracy for a session. request full accuracy for a session.
*/ */
- (void)requestTemporaryFullAccuracyAuthorizationWithPurposeKey:(NSString *)purposeKey - (void)requestTemporaryFullAccuracyAuthorizationWithPurposeKey:(NSString *)purposeKey
@@ -107,8 +107,8 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
The delegate to receive location updates. The delegate to receive location updates.
Do not set the location manager’s delegate yourself. `MLNMapView` sets this property Do not set the location manager’s delegate yourself. ``MLNMapView`` sets this property
after the location manager becomes `MLNMapView`’s location manager. after the location manager becomes ``MLNMapView``’s location manager.
*/ */
@property (nonatomic, weak) id<MLNLocationManagerDelegate> delegate; @property (nonatomic, weak) id<MLNLocationManagerDelegate> delegate;
@@ -171,9 +171,9 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
/** /**
The `MLNLocationManagerDelegate` protocol defines a set of methods that respond The ``MLNLocationManagerDelegate`` protocol defines a set of methods that respond
to location updates from an `MLNLocationManager` object that is serving as the to location updates from an ``MLNLocationManager`` object that is serving as the
location manager of an `MLNMapView`. location manager of an ``MLNMapView``.
*/ */
@protocol MLNLocationManagerDelegate <NSObject> @protocol MLNLocationManagerDelegate <NSObject>
@@ -185,7 +185,7 @@ NS_ASSUME_NONNULL_BEGIN
@param manager The location manager reporting the update. @param manager The location manager reporting the update.
@param locations An array of `CLLocation` objects in chronological order, @param locations An array of `CLLocation` objects in chronological order,
with the last object representing the most recent location. This array with the last object representing the most recent location. This array
contains multiple `CLLocation` objects when `MLNMapView` uses its contains multiple `CLLocation` objects when ``MLNMapView`` uses its
default location manager. default location manager.
*/ */
- (void)locationManager:(id<MLNLocationManager>)manager - (void)locationManager:(id<MLNLocationManager>)manager

View File

@@ -51,7 +51,8 @@ typedef NS_ENUM(NSInteger, MLNLoggingLevel) {
}; };
/** /**
A block to be called once `loggingLevel` is set to a higher value than `MLNLoggingLevelNone`. A block to be called once `loggingLevel` is set to a higher value than
``MLNLoggingLevel/MLNLoggingLevelNone``.
@param loggingLevel The message logging level. @param loggingLevel The message logging level.
@param filePath The description of the file and method for the calling message. @param filePath The description of the file and method for the calling message.
@@ -62,7 +63,7 @@ typedef void (^MLNLoggingBlockHandler)(MLNLoggingLevel loggingLevel, NSString *f
NSUInteger line, NSString *message); NSUInteger line, NSString *message);
/** /**
The `MLNLoggingConfiguration` object provides a global way to set this SDK logging levels The ``MLNLoggingConfiguration`` object provides a global way to set this SDK logging levels
and logging handler. and logging handler.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -81,7 +82,7 @@ MLN_EXPORT
/** /**
The logging level. The logging level.
The default value is `MLNLoggingLevelNone`. The default value is ``MLNLoggingLevel/MLNLoggingLevelNone``.
Setting this property includes logging levels less than or equal to the setted value. Setting this property includes logging levels less than or equal to the setted value.
*/ */

View File

@@ -7,7 +7,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
An `MLNMapCamera` object represents a viewpoint from which the user observes An ``MLNMapCamera`` object represents a viewpoint from which the user observes
some point on an ``MLNMapView``. some point on an ``MLNMapView``.
#### Related examples #### Related examples

View File

@@ -227,7 +227,7 @@ typedef void (^MLNMapSnapshotCompletionHandler)(MLNMapSnapshot *_Nullable snapsh
#### Related examples #### Related examples
TODO: Create a static map snapshot, learn how to use the TODO: Create a static map snapshot, learn how to use the
`MLNMapSnapshotter` to generate a static image based on an `MLNMapView` ``MLNMapSnapshotter`` to generate a static image based on an ``MLNMapSnapshotter``
object's style, camera, and view bounds. object's style, camera, and view bounds.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -267,7 +267,7 @@ MLN_EXPORT
/** /**
Starts the snapshot creation and executes the specified blocks with the result Starts the snapshot creation and executes the specified blocks with the result
on the specified queue. Use this option if you want to add custom drawing on on the specified queue. Use this option if you want to add custom drawing on
top of the resulting `MLNMapSnapshot`. top of the resulting ``MLNMapSnapshot``.
@param overlayHandler The block to call after the base map finishes drawing but @param overlayHandler The block to call after the base map finishes drawing but
before certain built-in overlays draw. The block can use Core Graphics to before certain built-in overlays draw. The block can use Core Graphics to

View File

@@ -7,16 +7,16 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNMultiPoint` class is an abstract superclass used to define shapes The ``MLNMultiPoint`` class is an abstract superclass used to define shapes
composed of multiple vertices. composed of multiple vertices.
Create instances of `MLNPolyline` or `MLNPolygon` in order to use Create instances of ``MLNPolyline`` or ``MLNPolyline`` in order to use
properties of `MLNMultiPoint`. Do not create instances of `MLNMultiPoint` properties of ``MLNMultiPoint``. Do not create instances of ``MLNMultiPoint``
directly and do not create your own subclasses of this class. You can use directly and do not create your own subclasses of this class. You can use
the method and properties of this class to access information about the the method and properties of this class to access information about the
vertices of the line or polygon. vertices of the line or polygon.
Do not confuse `MLNMultiPoint` with `MLNPointCollection`, which represents a Do not confuse ``MLNMultiPoint`` with ``MLNMultiPoint``, which represents a
collection of related but disconnected points. collection of related but disconnected points.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -62,8 +62,8 @@ MLN_EXPORT
Inserts the given vertices into the shape. Inserts the given vertices into the shape.
If the shape is currently visible on the map as an annotation, it is redrawn If the shape is currently visible on the map as an annotation, it is redrawn
immediately. If the shape is part of an `MLNShapeSource` object, you must immediately. If the shape is part of an ``MLNShapeSource`` object, you must
explicitly set the `MLNShapeSource.shape` property in order for any style explicitly set the ``MLNShapeSource/shape`` property in order for any style
layers that use the source to be redrawn. layers that use the source to be redrawn.
@param coords The array of coordinates to insert into the shape. The data in @param coords The array of coordinates to insert into the shape. The data in
@@ -80,8 +80,8 @@ MLN_EXPORT
Appends the given vertices to the shape. Appends the given vertices to the shape.
If the shape is currently visible on the map as an annotation, it is redrawn If the shape is currently visible on the map as an annotation, it is redrawn
immediately. If the shape is part of an `MLNShapeSource` object, you must immediately. If the shape is part of an ``MLNShapeSource`` object, you must
explicitly set the `MLNShapeSource.shape` property in order for any style explicitly set the ``MLNShapeSource/shape`` property in order for any style
layers that use the source to be redrawn. layers that use the source to be redrawn.
@param coords The array of coordinates to add to the shape. The data in this @param coords The array of coordinates to add to the shape. The data in this
@@ -95,8 +95,8 @@ MLN_EXPORT
vertices from a given C array. vertices from a given C array.
If the shape is currently visible on the map as an annotation, it is redrawn If the shape is currently visible on the map as an annotation, it is redrawn
immediately. If the shape is part of an `MLNShapeSource` object, you must immediately. If the shape is part of an ``MLNShapeSource`` object, you must
explicitly set the `MLNShapeSource.shape` property in order for any style explicitly set the ``MLNShapeSource/shape`` property in order for any style
layers that use the source to be redrawn. layers that use the source to be redrawn.
The number of coordinates in `coords` must be equal to the length of `range`. The number of coordinates in `coords` must be equal to the length of `range`.
@@ -122,8 +122,8 @@ MLN_EXPORT
of vertices from a given C array. of vertices from a given C array.
If the shape is currently visible on the map as an annotation, it is redrawn If the shape is currently visible on the map as an annotation, it is redrawn
immediately. If the shape is part of an `MLNShapeSource` object, you must immediately. If the shape is part of an ``MLNShapeSource`` object, you must
explicitly set the `MLNShapeSource.shape` property in order for any style explicitly set the ``MLNShapeSource/shape`` property in order for any style
layers that use the source to be redrawn. layers that use the source to be redrawn.
If `count` is greater than the `length` field of `range`, some vertices will If `count` is greater than the `length` field of `range`, some vertices will
@@ -153,8 +153,8 @@ MLN_EXPORT
Removes the vertices at the given range from the shape. Removes the vertices at the given range from the shape.
If the shape is currently visible on the map as an annotation, it is redrawn If the shape is currently visible on the map as an annotation, it is redrawn
immediately. If the shape is part of an `MLNShapeSource` object, you must immediately. If the shape is part of an ``MLNShapeSource`` object, you must
explicitly set the `MLNShapeSource.shape` property in order for any style explicitly set the ``MLNShapeSource/shape`` property in order for any style
layers that use the source to be redrawn. layers that use the source to be redrawn.
If `range` extends beyond the shape’s `coordinates` property, an If `range` extends beyond the shape’s `coordinates` property, an

View File

@@ -11,14 +11,14 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
:nodoc: :nodoc:
Provides an `NSURLSession` object for the specified `MLNNetworkConfiguration`. Provides an `NSURLSession` object for the specified ``MLNNetworkConfiguration``.
This API should be considered experimental, likely to be removed or changed in This API should be considered experimental, likely to be removed or changed in
future releases. future releases.
This method is called from background threads, i.e. it is not called on the main This method is called from background threads, i.e. it is not called on the main
thread. thread.
@note Background sessions (i.e. created with > Note: Background sessions (i.e. created with
`-[NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:]`) `-[NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:]`)
and sessions created with a delegate that conforms to `NSURLSessionDataDelegate` and sessions created with a delegate that conforms to `NSURLSessionDataDelegate`
are not supported at this time. are not supported at this time.
@@ -27,7 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
/** /**
The `MLNNetworkConfiguration` object provides a global way to set a base The ``MLNNetworkConfiguration`` object provides a global way to set a base
`NSURLSessionConfiguration`, and other resources. `NSURLSessionConfiguration`, and other resources.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -35,12 +35,12 @@ MLN_EXPORT
/** /**
:nodoc: :nodoc:
Delegate for the `MLNNetworkConfiguration` class. Delegate for the ``MLNNetworkConfiguration`` class.
*/ */
@property (nonatomic, weak) id<MLNNetworkConfigurationDelegate> delegate; @property (nonatomic, weak) id<MLNNetworkConfigurationDelegate> delegate;
/** /**
Returns the shared instance of the `MLNNetworkConfiguration` class. Returns the shared instance of the ``MLNNetworkConfiguration`` class.
*/ */
@property (class, nonatomic, readonly) MLNNetworkConfiguration *sharedManager; @property (class, nonatomic, readonly) MLNNetworkConfiguration *sharedManager;
@@ -51,14 +51,14 @@ MLN_EXPORT
If this property is set to nil or if no session configuration is provided this property If this property is set to nil or if no session configuration is provided this property
is set to the default session configuration. is set to the default session configuration.
Assign this object before instantiating any `MLNMapView` object, or using Assign this object before instantiating any ``MLNMapView`` object, or using
`MLNOfflineStorage` ``MLNOfflineStorage``
@note `NSURLSession` objects store a copy of this configuration. Any further changes > Note: `NSURLSession` objects store a copy of this configuration. Any further changes
to mutable properties on this configuration object passed to a session’s initializer to mutable properties on this configuration object passed to a session’s initializer
will not affect the behavior of that session. will not affect the behavior of that session.
@note Background sessions are not currently supported. > Note: Background sessions are not currently supported.
*/ */
@property (atomic, strong, null_resettable) NSURLSessionConfiguration *sessionConfiguration; @property (atomic, strong, null_resettable) NSURLSessionConfiguration *sessionConfiguration;

View File

@@ -16,28 +16,28 @@ typedef NS_ENUM(NSInteger, MLNOfflinePackState) {
It is unknown whether the pack is inactive, active, or complete. It is unknown whether the pack is inactive, active, or complete.
This is the initial state of a pack. The state of a pack becomes known by This is the initial state of a pack. The state of a pack becomes known by
the time the shared `MLNOfflineStorage` object sends the first the time the shared ``MLNOfflineStorage`` object sends the first
`MLNOfflinePackProgressChangedNotification` about the pack. For inactive ``MLNOfflinePackProgressChangedNotification`` about the pack. For inactive
packs, you must explicitly request a progress update using the packs, you must explicitly request a progress update using the
`-[MLNOfflinePack requestProgress]` method. ``MLNOfflinePack/requestProgress`` method.
An invalid pack always has a state of `MLNOfflinePackStateInvalid`, never An invalid pack always has a state of ``MLNOfflinePackStateInvalid``, never
`MLNOfflinePackStateUnknown`. ``MLNOfflinePackState/MLNOfflinePackStateUnknown``.
*/ */
MLNOfflinePackStateUnknown = 0, MLNOfflinePackStateUnknown = 0,
/** /**
The pack is incomplete and is not currently downloading. The pack is incomplete and is not currently downloading.
This is the initial state of a pack that is created using the This is the initial state of a pack that is created using the
`-[MLNOfflineStorage addPackForRegion:withContext:completionHandler:]` ``MLNOfflineStorage/addPackForRegion:withContext:completionHandler:``
method, as well as after the `-[MLNOfflinePack suspend]` method is method, as well as after the ``MLNOfflinePack/suspend`` method is
called. called.
*/ */
MLNOfflinePackStateInactive = 1, MLNOfflinePackStateInactive = 1,
/** /**
The pack is incomplete and is currently downloading. The pack is incomplete and is currently downloading.
This is the state of a pack after the `-[MLNOfflinePack resume]` method is This is the state of a pack after the ``MLNOfflinePack/resume`` method is
called. called.
*/ */
MLNOfflinePackStateActive = 2, MLNOfflinePackStateActive = 2,
@@ -47,7 +47,7 @@ typedef NS_ENUM(NSInteger, MLNOfflinePackState) {
MLNOfflinePackStateComplete = 3, MLNOfflinePackStateComplete = 3,
/** /**
The pack has been removed using the The pack has been removed using the
`-[MLNOfflineStorage removePack:withCompletionHandler:]` method. Sending ``MLNOfflineStorage/removePack:withCompletionHandler:`` method. Sending
any message to the pack will raise an exception. any message to the pack will raise an exception.
*/ */
MLNOfflinePackStateInvalid = 4, MLNOfflinePackStateInvalid = 4,
@@ -97,12 +97,12 @@ typedef struct __attribute__((objc_boxable)) MLNOfflinePackProgress {
} MLNOfflinePackProgress; } MLNOfflinePackProgress;
/** /**
An `MLNOfflinePack` represents a collection of resources necessary for viewing An ``MLNOfflinePack`` represents a collection of resources necessary for viewing
a region offline to a local database. a region offline to a local database.
To create an instance of `MLNOfflinePack`, use the To create an instance of ``MLNOfflinePack``, use the
`+[MLNOfflineStorage addPackForRegion:withContext:completionHandler:]` method. ``MLNOfflineStorage/addPackForRegion:withContext:completionHandler:`` method.
A pack created using `-[MLNOfflinePack init]` is immediately invalid. A pack created using `MLNOfflinePack/init` is immediately invalid.
### Example ### Example
```swift ```swift
@@ -158,11 +158,12 @@ MLN_EXPORT
The pack’s current state. The pack’s current state.
The state of an inactive or completed pack is computed lazily and is set to The state of an inactive or completed pack is computed lazily and is set to
`MLNOfflinePackStateUnknown` by default. To request the pack’s status, use the ``MLNOfflinePackState/MLNOfflinePackStateUnknown`` by default. To request the pack’s status, use
the
`-requestProgress` method. To get notified when the state becomes known and `-requestProgress` method. To get notified when the state becomes known and
when it changes, observe KVO change notifications on this pack’s `state` key when it changes, observe KVO change notifications on this pack’s `state` key
path. Alternatively, you can add an observer for path. Alternatively, you can add an observer for
`MLNOfflinePackProgressChangedNotification`s about this pack that come from the ``MLNOfflinePackProgressChangedNotification``s about this pack that come from the
default notification center. default notification center.
*/ */
@property (nonatomic, readonly) MLNOfflinePackState state; @property (nonatomic, readonly) MLNOfflinePackState state;
@@ -175,7 +176,7 @@ MLN_EXPORT
`-requestProgress` method. To get notified when the progress becomes `-requestProgress` method. To get notified when the progress becomes
known and when it changes, observe KVO change notifications on this pack’s known and when it changes, observe KVO change notifications on this pack’s
`state` key path. Alternatively, you can add an observer for `state` key path. Alternatively, you can add an observer for
`MLNOfflinePackProgressChangedNotification`s about this pack that come from the ``MLNOfflinePackProgressChangedNotification``s about this pack that come from the
default notification center. default notification center.
*/ */
@property (nonatomic, readonly) MLNOfflinePackProgress progress; @property (nonatomic, readonly) MLNOfflinePackProgress progress;
@@ -211,9 +212,9 @@ MLN_EXPORT
The state and progress of an inactive or completed pack are computed lazily. If The state and progress of an inactive or completed pack are computed lazily. If
you need the state or progress of a pack whose `state` property is currently you need the state or progress of a pack whose `state` property is currently
set to `MLNOfflinePackStateUnknown`, observe KVO change notifications on this set to ``MLNOfflinePackState/MLNOfflinePackStateUnknown``, observe KVO change notifications on this
pack’s `state` key path, then call this method. Alternatively, you can add an pack’s `state` key path, then call this method. Alternatively, you can add an
observer for `MLNOfflinePackProgressChangedNotification` about this pack that observer for ``MLNOfflinePackProgressChangedNotification`` about this pack that
come from the default notification center. come from the default notification center.
*/ */
- (void)requestProgress; - (void)requestProgress;

View File

@@ -20,7 +20,7 @@ const MLNExceptionName MLNInvalidOfflinePackException = @"MLNInvalidOfflinePackE
Assert that the current offline pack is valid. Assert that the current offline pack is valid.
This macro should be used at the beginning of any public-facing instance method This macro should be used at the beginning of any public-facing instance method
of `MLNOfflinePack`. For private methods, an assertion is more appropriate. of ``MLNOfflinePack``. For private methods, an assertion is more appropriate.
*/ */
#define MLNAssertOfflinePackIsValid() \ #define MLNAssertOfflinePackIsValid() \
do { \ do { \

View File

@@ -3,8 +3,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
An object conforming to the `MLNOfflineRegion` protocol determines which An object conforming to the ``MLNOfflineRegion`` protocol determines which
resources are required by an `MLNOfflinePack` object. resources are required by an ``MLNOfflinePack`` object.
*/ */
@protocol MLNOfflineRegion <NSObject> @protocol MLNOfflineRegion <NSObject>

View File

@@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
The `object` is the ``MLNOfflinePack`` object whose progress changed. The The `object` is the ``MLNOfflinePack`` object whose progress changed. The
`userInfo` dictionary contains the pack’s current state in the `userInfo` dictionary contains the pack’s current state in the
`MLNOfflinePackUserInfoKeyState` key and details about the pack’s current ``MLNOfflinePackUserInfoKeyState`` key and details about the pack’s current
progress in the ``MLNOfflinePackUserInfoKeyProgress`` key. You may also consult progress in the ``MLNOfflinePackUserInfoKeyProgress`` key. You may also consult
the ``MLNOfflinePack/state`` and ``MLNOfflinePack/progress`` properties, which the ``MLNOfflinePack/state`` and ``MLNOfflinePack/progress`` properties, which
provide the same values. provide the same values.
@@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
FOUNDATION_EXTERN MLN_EXPORT const NSNotificationName MLNOfflinePackProgressChangedNotification; FOUNDATION_EXTERN MLN_EXPORT const NSNotificationName MLNOfflinePackProgressChangedNotification;
/** /**
Posted by the shared `MLNOfflineStorage` object whenever an `MLNOfflinePack` Posted by the shared ``MLNOfflineStorage`` object whenever an ``MLNOfflineStorage``
object encounters an error while downloading. The error may be recoverable and object encounters an error while downloading. The error may be recoverable and
may not warrant the user’s attention. For example, the pack’s implementation may not warrant the user’s attention. For example, the pack’s implementation
may attempt to re-request failed resources based on an exponential backoff may attempt to re-request failed resources based on an exponential backoff
@@ -42,7 +42,7 @@ FOUNDATION_EXTERN MLN_EXPORT const NSNotificationName MLNOfflinePackProgressChan
The `object` is the ``MLNOfflinePack`` object that encountered the error. The The `object` is the ``MLNOfflinePack`` object that encountered the error. The
`userInfo` dictionary contains the error object in the `userInfo` dictionary contains the error object in the
`MLNOfflinePackUserInfoKeyError` key. ``MLNOfflinePackUserInfoKeyError`` key.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const NSNotificationName MLNOfflinePackErrorNotification; FOUNDATION_EXTERN MLN_EXPORT const NSNotificationName MLNOfflinePackErrorNotification;
@@ -52,7 +52,7 @@ FOUNDATION_EXTERN MLN_EXPORT const NSNotificationName MLNOfflinePackErrorNotific
The `object` is the ``MLNOfflinePack`` object that reached the tile limit in the The `object` is the ``MLNOfflinePack`` object that reached the tile limit in the
course of downloading. The `userInfo` dictionary contains the tile limit in the course of downloading. The `userInfo` dictionary contains the tile limit in the
`MLNOfflinePackUserInfoKeyMaximumCount` key. ``MLNOfflinePackUserInfoKeyMaximumCount`` key.
Once this limit is reached, no instance of ``MLNOfflinePack`` can download Once this limit is reached, no instance of ``MLNOfflinePack`` can download
additional tiles until already downloaded tiles are removed by additional tiles until already downloaded tiles are removed by
@@ -70,24 +70,24 @@ typedef NSString *MLNOfflinePackUserInfoKey NS_EXTENSIBLE_STRING_ENUM;
The key for an `NSNumber` object that indicates an offline pack’s current The key for an `NSNumber` object that indicates an offline pack’s current
state. This key is used in the `userInfo` dictionary of an state. This key is used in the `userInfo` dictionary of an
``MLNOfflinePackProgressChangedNotification`` notification. Call `-integerValue` ``MLNOfflinePackProgressChangedNotification`` notification. Call `-integerValue`
on the object to receive the `MLNOfflinePackState`-typed state. on the object to receive the ``MLNOfflinePackState``-typed state.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyState; FOUNDATION_EXTERN MLN_EXPORT const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyState;
/** /**
The key for an `NSValue` object that indicates an offline pack’s current The key for an `NSValue` object that indicates an offline pack’s current
progress. This key is used in the `userInfo` dictionary of an progress. This key is used in the `userInfo` dictionary of an
`MLNOfflinePackProgressChangedNotification` notification. Call ``MLNOfflinePackProgressChangedNotification`` notification. Call
`-MLNOfflinePackProgressValue` on the object to receive the `-MLNOfflinePackProgressValue` on the object to receive the
`MLNOfflinePackProgress`-typed progress. ``MLNOfflinePackProgress``-typed progress.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyProgress; FOUNDATION_EXTERN MLN_EXPORT const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyProgress;
/** /**
The key for an `NSError` object that is encountered in the course of The key for an `NSError` object that is encountered in the course of
downloading an offline pack. This key is used in the `userInfo` dictionary of downloading an offline pack. This key is used in the `userInfo` dictionary of
an `MLNOfflinePackErrorNotification` notification. The error’s domain is an ``MLNOfflinePackErrorNotification`` notification. The error’s domain is
`MLNErrorDomain`. See `MLNErrorCode` for possible error codes. ``MLNErrorDomain``. See ``MLNErrorDomain`` for possible error codes.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyError; FOUNDATION_EXTERN MLN_EXPORT const MLNOfflinePackUserInfoKey MLNOfflinePackUserInfoKeyError;
@@ -293,10 +293,10 @@ MLN_EXPORT
The resulting pack is added to the shared offline storage object’s `packs` The resulting pack is added to the shared offline storage object’s `packs`
property, then the `completion` block is executed with that pack passed in. property, then the `completion` block is executed with that pack passed in.
The pack has an initial state of `MLNOfflinePackStateInactive`. To begin The pack has an initial state of ``MLNOfflinePackState/MLNOfflinePackStateInactive``. To begin
downloading resources, call `-[MLNOfflinePack resume]` on the pack from within downloading resources, call ``MLNOfflinePack/resume`` on the pack from within
the completion handler. To monitor download progress, add an observer for the completion handler. To monitor download progress, add an observer for
`MLNOfflinePackProgressChangedNotification`s about that pack. ``MLNOfflinePackProgressChangedNotification``s about that pack.
To detect when any call to this method results in a new pack, observe KVO To detect when any call to this method results in a new pack, observe KVO
change notifications on the shared offline storage object’s `packs` key path. change notifications on the shared offline storage object’s `packs` key path.

View File

@@ -7,7 +7,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNOverlay` protocol defines a specific type of annotation that represents The ``MLNOverlay`` protocol defines a specific type of annotation that represents
both a point and an area on a map. Overlay objects are essentially data objects 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. Overlays can that contain the geographic data needed to represent the map area. Overlays can
take the form of a polyline or polygon. take the form of a polyline or polygon.

View File

@@ -7,29 +7,29 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
An `MLNPointAnnotation` object represents a one-dimensional shape located at a An ``MLNPointAnnotation`` object represents a one-dimensional shape located at a
single geographical coordinate. Depending on how it is used, an single geographical coordinate. Depending on how it is used, an
`MLNPointAnnotation` object is known as a point annotation or point shape. For ``MLNPointAnnotation`` object is known as a point annotation or point shape. For
example, you could use a point shape to represent a city at low zoom levels, an example, you could use a point shape to represent a city at low zoom levels, an
address at high zoom levels, or the location of a long press gesture. address at high zoom levels, or the location of a long press gesture.
You can add point shapes to the map by adding them to an `MLNShapeSource` You can add point shapes to the map by adding them to an ``MLNShapeSource``
object. Configure the appearance of an `MLNShapeSource`’s or object. Configure the appearance of an ``MLNShapeSource``’s or
`MLNVectorTileSource`’s point shapes collectively using an `MLNCircleStyleLayer` or ``MLNVectorTileSource``’s point shapes collectively using an ``MLNVectorTileSource`` or
`MLNSymbolStyleLayer` object. ``MLNSymbolStyleLayer`` object.
For more interactivity, add a selectable point annotation to a map view using For more interactivity, add a selectable point annotation to a map view using
the `-[MLNMapView addAnnotation:]` method. Alternatively, define your own model the ``MLNMapView/addAnnotation:`` method. Alternatively, define your own model
class that conforms to the `MLNAnnotation` protocol. Configure a point class that conforms to the ``MLNAnnotation`` protocol. Configure a point
annotation’s appearance using annotation’s appearance using
`-[MLNMapViewDelegate mapView:imageForAnnotation:]` or ``MLNMapViewDelegate/mapView:imageForAnnotation:`` or
`-[MLNMapViewDelegate mapView:viewForAnnotation:]` (iOS only). A point ``MLNMapViewDelegate/mapView:viewForAnnotation:`` (iOS only). A point
annotation’s `MLNShape.title` and `MLNShape.subtitle` properties define the annotation’s ``MLNShape/title`` and ``MLNShape/title`` properties define the
default content of the annotation’s callout (on iOS) or popover (on macOS). default content of the annotation’s callout (on iOS) or popover (on macOS).
To group multiple related points together in one shape, use an To group multiple related points together in one shape, use an
`MLNPointCollection` or `MLNShapeCollection` object. To access ``MLNPointCollection`` or ``MLNPointCollection`` object. To access
a point’s attributes, use an `MLNPointFeature` object. a point’s attributes, use an ``MLNPointFeature`` object.
A point shape is known as a A point shape is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.2">Point</a> geometry <a href="https://tools.ietf.org/html/rfc7946#section-3.1.2">Point</a> geometry
@@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN
TODO: Mark a place on the map with an annotation TODO: Mark a place on the map with an annotation
TODO: Mark a place on the map with an image TODO: Mark a place on the map with an image
TODO: Default callout usage TODO: Default callout usage
Learn how to add `MLNPointAnnotation` objects to your map. Learn how to add ``MLNPointAnnotation`` objects to your map.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNPointAnnotation : MLNShape @interface MLNPointAnnotation : MLNShape

View File

@@ -6,33 +6,33 @@
#import "MLNShape.h" #import "MLNShape.h"
/** /**
An `MLNPointCollection` object represents a shape consisting of one or more An ``MLNPointCollection`` object represents a shape consisting of one or more
disconnected vertices, specified as `CLLocationCoordinate2D` instances. The disconnected vertices, specified as `CLLocationCoordinate2D` instances. The
points in the collection may be related but are not connected spatially. For points in the collection may be related but are not connected spatially. For
example, you could use a point collection to represent all the trees in an example, you could use a point collection to represent all the trees in an
orchard. orchard.
You can add point collections to the map by adding them to an `MLNShapeSource` You can add point collections to the map by adding them to an ``MLNShapeSource``
object. Configure the appearance of an `MLNShapeSource`’s or object. Configure the appearance of an ``MLNShapeSource``’s or
`MLNVectorTileSource`’s point collections collectively using an ``MLNVectorTileSource``’s point collections collectively using an
`MLNCircleStyleLayer` or `MLNSymbolStyleLayer` object. To access a point ``MLNCircleStyleLayer`` or ``MLNCircleStyleLayer`` object. To access a point
collection’s attributes, use an `MLNPointCollectionFeature` object. collection’s attributes, use an ``MLNPointCollectionFeature`` object.
You cannot add an `MLNPointCollection` object directly to a map view as an You cannot add an ``MLNPointCollection`` object directly to a map view as an
annotation. However, you can create individual `MLNPointAnnotation` objects annotation. However, you can create individual ``MLNPointAnnotation`` objects
from the `coordinates` array and add those annotation objects to the map view from the `coordinates` array and add those annotation objects to the map view
using the `-[MLNMapView addAnnotations:]` method. using the ``MLNMapView/addAnnotations:`` method.
A point collection is known as a A point collection is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.3">MultiPoint</a> <a href="https://tools.ietf.org/html/rfc7946#section-3.1.3">MultiPoint</a>
geometry in GeoJSON. Do not confuse `MLNPointCollection` with `MLNMultiPoint`, geometry in GeoJSON. Do not confuse ``MLNPointCollection`` with ``MLNPointCollection``,
the abstract superclass of `MLNPolyline` and `MLNPolygon`. the abstract superclass of ``MLNPolyline`` and ``MLNPolyline``.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNPointCollection : MLNShape <MLNOverlay> @interface MLNPointCollection : MLNShape <MLNOverlay>
/** /**
Creates and returns a `MLNPointCollection` object from the specified set of Creates and returns a ``MLNPointCollection`` object from the specified set of
coordinates. coordinates.
@param coords The array of coordinates defining the shape. The data in this @param coords The array of coordinates defining the shape. The data in this

View File

@@ -10,44 +10,44 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
An `MLNPolygon` object represents a closed shape consisting of four or more An ``MLNPolygon`` object represents a closed shape consisting of four or more
vertices, specified as `CLLocationCoordinate2D` instances, and the edges that vertices, specified as `CLLocationCoordinate2D` instances, and the edges that
connect them. For example, you could use a polygon shape to represent a connect them. For example, you could use a polygon shape to represent a
building, a lake, or an area you want to highlight. building, a lake, or an area you want to highlight.
You can add polygon shapes to the map by adding them to an `MLNShapeSource` You can add polygon shapes to the map by adding them to an ``MLNShapeSource``
object. Configure the appearance of an `MLNShapeSource`’s or object. Configure the appearance of an ``MLNShapeSource``’s or
`MLNVectorTileSource`’s polygons collectively using an `MLNFillStyleLayer` or ``MLNVectorTileSource``’s polygons collectively using an ``MLNVectorTileSource`` or
`MLNSymbolStyleLayer` object. To access a polygon’s attributes, use an ``MLNSymbolStyleLayer`` object. To access a polygon’s attributes, use an
`MLNPolygonFeature` object. ``MLNPolygonFeature`` object.
Alternatively, you can add a polygon overlay directly to a map view using the Alternatively, you can add a polygon overlay directly to a map view using the
`-[MLNMapView addAnnotation:]` or `-[MLNMapView addOverlay:]` method. Configure ``MLNMapView/addAnnotation:`` or ``MLNMapView/addOverlay:`` method. Configure
a polygon overlay’s appearance using a polygon overlay’s appearance using
`-[MLNMapViewDelegate mapView:strokeColorForShapeAnnotation:]` and ``MLNMapViewDelegate/mapView:strokeColorForShapeAnnotation:`` and
`-[MLNMapViewDelegate mapView:fillColorForPolygonAnnotation:]`. ``MLNMapViewDelegate/mapView:fillColorForPolygonAnnotation:``.
The vertices are automatically connected in the order in which you provide The vertices are automatically connected in the order in which you provide
them. You should close the polygon by specifying the same them. You should close the polygon by specifying the same
`CLLocationCoordinate2D` as the first and last vertices; otherwise, the `CLLocationCoordinate2D` as the first and last vertices; otherwise, the
polygon’s fill may not cover the area you expect it to. To avoid filling the polygon’s fill may not cover the area you expect it to. To avoid filling the
space within the shape, give the polygon a transparent fill or use an space within the shape, give the polygon a transparent fill or use an
`MLNPolyline` object. ``MLNPolyline`` object.
A polygon may have one or more interior polygons, or holes, that you specify as A polygon may have one or more interior polygons, or holes, that you specify as
`MLNPolygon` objects with the `+polygonWithCoordinates:count:interiorPolygons:` ``MLNPolygon`` objects with the `+polygonWithCoordinates:count:interiorPolygons:`
method. For example, if a polygon represents a lake, it could exclude an island method. For example, if a polygon represents a lake, it could exclude an island
within the lake using an interior polygon. Interior polygons may not themselves within the lake using an interior polygon. Interior polygons may not themselves
have interior polygons. To represent a shape that includes a polygon within a have interior polygons. To represent a shape that includes a polygon within a
hole or, more generally, to group multiple polygons together in one shape, use hole or, more generally, to group multiple polygons together in one shape, use
an `MLNMultiPolygon` or `MLNShapeCollection` object. an ``MLNMultiPolygon`` or ``MLNMultiPolygon`` object.
To make the polygon straddle the antimeridian, specify some longitudes less To make the polygon straddle the antimeridian, specify some longitudes less
than −180 degrees or greater than 180 degrees. than −180 degrees or greater than 180 degrees.
#### Related examples #### Related examples
TODO: Add a polygon annotation, learn how to initialize an TODO: Add a polygon annotation, learn how to initialize an
`MLNPolygon` object from an array of coordinates. ``MLNPolygon`` object from an array of coordinates.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNPolygon : MLNMultiPoint <MLNOverlay> @interface MLNPolygon : MLNMultiPoint <MLNOverlay>
@@ -64,7 +64,7 @@ MLN_EXPORT
@property (nonatomic, nullable, readonly) NSArray<MLNPolygon *> *interiorPolygons; @property (nonatomic, nullable, readonly) NSArray<MLNPolygon *> *interiorPolygons;
/** /**
Creates and returns an `MLNPolygon` object from the specified set of Creates and returns an ``MLNPolygon`` object from the specified set of
coordinates. coordinates.
@param coords The array of coordinates defining the shape. The data in this @param coords The array of coordinates defining the shape. The data in this
@@ -76,13 +76,13 @@ MLN_EXPORT
count:(NSUInteger)count; count:(NSUInteger)count;
/** /**
Creates and returns an `MLNPolygon` object from the specified set of Creates and returns an ``MLNPolygon`` object from the specified set of
coordinates and interior polygons. coordinates and interior polygons.
@param coords The array of coordinates defining the shape. The data in this @param coords The array of coordinates defining the shape. The data in this
array is copied to the new object. array is copied to the new object.
@param count The number of items in the `coords` array. @param count The number of items in the `coords` array.
@param interiorPolygons An array of `MLNPolygon` objects that define regions @param interiorPolygons An array of ``MLNPolygon`` objects that define regions
excluded from the overall shape. If this array is `nil` or empty, the shape excluded from the overall shape. If this array is `nil` or empty, the shape
is considered to have no interior polygons. is considered to have no interior polygons.
@return A new polygon object. @return A new polygon object.
@@ -94,20 +94,20 @@ MLN_EXPORT
@end @end
/** /**
An `MLNMultiPolygon` object represents a shape consisting of one or more An ``MLNMultiPolygon`` object represents a shape consisting of one or more
polygons that do not overlap. For example, you could use a multipolygon shape polygons that do not overlap. For example, you could use a multipolygon shape
to represent the body of land that consists of an island surrounded by an to represent the body of land that consists of an island surrounded by an
atoll: the inner island would be one `MLNPolygon` object, while the surrounding atoll: the inner island would be one ``MLNPolygon`` object, while the surrounding
atoll would be another. You could also use a multipolygon shape to represent a atoll would be another. You could also use a multipolygon shape to represent a
group of disconnected but related buildings. group of disconnected but related buildings.
You can add multipolygon shapes to the map by adding them to an You can add multipolygon shapes to the map by adding them to an
`MLNShapeSource` object. Configure the appearance of an `MLNShapeSource`’s or ``MLNShapeSource`` object. Configure the appearance of an ``MLNShapeSource``’s or
`MLNVectorTileSource`’s multipolygons collectively using an `MLNFillStyleLayer` ``MLNVectorTileSource``’s multipolygons collectively using an ``MLNVectorTileSource``
or `MLNSymbolStyleLayer` object. or ``MLNSymbolStyleLayer`` object.
You cannot add an `MLNMultiPolygon` object directly to a map view using You cannot add an ``MLNMultiPolygon`` object directly to a map view using
`-[MLNMapView addAnnotation:]` or `-[MLNMapView addOverlay:]`. However, you can ``MLNMapView/addAnnotation:`` or ``MLNMapView/addOverlay:``. However, you can
add the `polygons` array’s items as overlays individually. add the `polygons` array’s items as overlays individually.
*/ */
MLN_EXPORT MLN_EXPORT

View File

@@ -10,7 +10,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
An `MLNPolyline` object represents a shape consisting of two or more vertices, An ``MLNPolyline`` object represents a shape consisting of two or more vertices,
specified as `CLLocationCoordinate2D` instances, and the line segments that specified as `CLLocationCoordinate2D` instances, and the line segments that
connect them. For example, you could use an polyline to represent a road or the connect them. For example, you could use an polyline to represent a road or the
path along which something moves. path along which something moves.
@@ -60,7 +60,7 @@ MLN_EXPORT
@interface MLNPolyline : MLNMultiPoint <MLNOverlay> @interface MLNPolyline : MLNMultiPoint <MLNOverlay>
/** /**
Creates and returns an `MLNPolyline` object from the specified set of Creates and returns an ``MLNPolyline`` object from the specified set of
coordinates. coordinates.
@param coords The array of coordinates defining the shape. The data in this @param coords The array of coordinates defining the shape. The data in this
@@ -77,10 +77,10 @@ MLN_EXPORT
An ``MLNMultiPolyline`` object represents a shape consisting of one or more An ``MLNMultiPolyline`` object represents a shape consisting of one or more
polylines. For example, you could use a multipolyline shape to represent both polylines. For example, you could use a multipolyline shape to represent both
sides of a divided highway (dual carriageway), excluding the median (central sides of a divided highway (dual carriageway), excluding the median (central
reservation): each carriageway would be a distinct `MLNPolyline` object. reservation): each carriageway would be a distinct ``MLNPolyline`` object.
You can add multipolyline shapes to the map by adding them to an You can add multipolyline shapes to the map by adding them to an
``MLNShapeSource`` object. Configure the appearance of an `MLNShapeSource`’s or ``MLNShapeSource`` object. Configure the appearance of an ``MLNShapeSource``’s or
``MLNVectorTileSource``’s multipolylines collectively using an ``MLNVectorTileSource``’s multipolylines collectively using an
``MLNLineStyleLayer`` or ``MLNSymbolStyleLayer`` object. ``MLNLineStyleLayer`` or ``MLNSymbolStyleLayer`` object.

View File

@@ -5,33 +5,33 @@
/** /**
An `NSNumber` object containing an unsigned integer that specifies the encoding An `NSNumber` object containing an unsigned integer that specifies the encoding
formula for raster-dem tilesets. The integer corresponds to one of formula for raster-dem tilesets. The integer corresponds to one of
the constants described in `MLNDEMEncoding`. the constants described in ``MLNDEMEncoding``.
The default value for this option is `MLNDEMEncodingMapbox`. The default value for this option is ``MLNDEMEncoding/MLNDEMEncodingMapbox``.
This option cannot be represented in a TileJSON or style JSON file. It is used This option cannot be represented in a TileJSON or style JSON file. It is used
with the `MLNRasterDEMSource` class and is ignored when creating an with the ``MLNRasterDEMSource`` class and is ignored when creating an
`MLNRasterTileSource` or `MLNVectorTileSource` object. ``MLNRasterTileSource`` or ``MLNRasterTileSource`` object.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionDEMEncoding; FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionDEMEncoding;
/** /**
`MLNRasterDEMSource` is a map content source that supplies rasterized ``MLNRasterDEMSource`` is a map content source that supplies rasterized
<a href="https://en.wikipedia.org/wiki/Digital_elevation_model">digital elevation model</a> <a href="https://en.wikipedia.org/wiki/Digital_elevation_model">digital elevation model</a>
(DEM) tiles to be shown on the map. The location of and metadata about the (DEM) tiles to be shown on the map. The location of and metadata about the
tiles are defined either by an option dictionary or by an external file that tiles are defined either by an option dictionary or by an external file that
conforms to the conforms to the
<a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>. <a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>.
A raster DEM source is added to an `MLNStyle` object along with one or more A raster DEM source is added to an ``MLNStyle`` object along with one or more
`MLNHillshadeStyleLayer` objects. Use a hillshade style layer to control the ``MLNHillshadeStyleLayer`` objects. Use a hillshade style layer to control the
appearance of content supplied by the raster DEM source. appearance of content supplied by the raster DEM source.
Each Each
<a href="https://maplibre.org/maplibre-style-spec/#sources-raster-dem"><code>raster-dem</code></a> <a href="https://maplibre.org/maplibre-style-spec/#sources-raster-dem"><code>raster-dem</code></a>
source defined by the style JSON file is represented at runtime by an source defined by the style JSON file is represented at runtime by an
`MLNRasterDEMSource` object that you can use to initialize new style layers. ``MLNRasterDEMSource`` object that you can use to initialize new style layers.
You can also add and remove sources dynamically using methods such as You can also add and remove sources dynamically using methods such as
`-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. ``MLNStyle/addSource:`` and ``MLNStyle/sourceWithIdentifier:``.
Currently, raster DEM sources only support the format used by Currently, raster DEM sources only support the format used by
<a <a

View File

@@ -17,27 +17,27 @@ NS_ASSUME_NONNULL_BEGIN
requires a value of 256, as do many third-party tile servers, so consult your requires a value of 256, as do many third-party tile servers, so consult your
provider’s documentation for the correct value. provider’s documentation for the correct value.
This option is only applicable to `MLNRasterTileSource` objects; it is ignored This option is only applicable to ``MLNRasterTileSource`` objects; it is ignored
when initializing `MLNVectorTileSource` objects. when initializing ``MLNVectorTileSource`` objects.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionTileSize; FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionTileSize;
/** /**
`MLNRasterTileSource` is a map content source that supplies raster image tiles ``MLNRasterTileSource`` is a map content source that supplies raster image tiles
to be shown on the map. The location of and metadata about the tiles are to be shown on the map. The location of and metadata about the tiles are
defined either by an option dictionary or by an external file that conforms to defined either by an option dictionary or by an external file that conforms to
the the
<a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>. <a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>.
A raster tile source is added to an `MLNStyle` object along with one or more A raster tile source is added to an ``MLNStyle`` object along with one or more
`MLNRasterStyleLayer` objects. Use a raster style layer to control the ``MLNRasterStyleLayer`` objects. Use a raster style layer to control the
appearance of content supplied by the raster tile source. appearance of content supplied by the raster tile source.
Each Each
<a href="https://maplibre.org/maplibre-style-spec/#sources-raster"><code>raster</code></a> <a href="https://maplibre.org/maplibre-style-spec/#sources-raster"><code>raster</code></a>
source defined by the style JSON file is represented at runtime by an source defined by the style JSON file is represented at runtime by an
`MLNRasterTileSource` object that you can use to initialize new style layers. You ``MLNRasterTileSource`` object that you can use to initialize new style layers. You
can also add and remove sources dynamically using methods such as can also add and remove sources dynamically using methods such as
`-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. ``MLNStyle/addSource:`` and ``MLNStyle/sourceWithIdentifier:``.
### Example ### Example
@@ -55,8 +55,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionTileSi
``` ```
#### Related examples #### Related examples
TODO: Add raster imagery, learn how to add a `MLNRasterStyleLayer` TODO: Add raster imagery, learn how to add a ``MLNRasterStyleLayer``
to your map using an `MLNRasterTileSource`. to your map using an ``MLNRasterTileSource``.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNRasterTileSource : MLNTileSource @interface MLNRasterTileSource : MLNTileSource
@@ -68,7 +68,7 @@ MLN_EXPORT
URL. URL.
After initializing and configuring the source, add it to a map view’s style After initializing and configuring the source, add it to a map view’s style
using the `-[MLNStyle addSource:]` method. using the ``MLNStyle/addSource:`` method.
The URL may be a full HTTP or HTTPS URL or canonical URL. The URL should The URL may be a full HTTP or HTTPS URL or canonical URL. The URL should
point to a JSON file that conforms to the point to a JSON file that conforms to the
@@ -76,7 +76,7 @@ MLN_EXPORT
If a Mapbox URL is specified, this source uses a tile size of 256. For all If a Mapbox URL is specified, this source uses a tile size of 256. For all
other tilesets, the default value is 512. (See the other tilesets, the default value is 512. (See the
`MLNTileSourceOptionTileSize` documentation for more information about tile ``MLNTileSourceOptionTileSize`` documentation for more information about tile
sizes.) If you need to use a tile size other than the default, use the sizes.) If you need to use a tile size other than the default, use the
`-initWithIdentifier:configurationURL:tileSize:` method. `-initWithIdentifier:configurationURL:tileSize:` method.
@@ -94,7 +94,7 @@ MLN_EXPORT
and tile size. and tile size.
After initializing and configuring the source, add it to a map view’s style After initializing and configuring the source, add it to a map view’s style
using the `-[MLNStyle addSource:]` method. using the ``MLNStyle/addSource:`` method.
The URL may be a full HTTP or HTTPS URL or, canonical URL. The URL should The URL may be a full HTTP or HTTPS URL or, canonical URL. The URL should
point to a JSON file that conforms to the point to a JSON file that conforms to the
@@ -105,7 +105,7 @@ MLN_EXPORT
@param configurationURL A URL to a TileJSON configuration file describing the @param configurationURL A URL to a TileJSON configuration file describing the
source’s contents and other metadata. source’s contents and other metadata.
@param tileSize The width and height (measured in points) of each tiled image @param tileSize The width and height (measured in points) of each tiled image
in the raster tile source. See the `MLNTileSourceOptionTileSize` in the raster tile source. See the ``MLNTileSourceOptionTileSize``
documentation for details. documentation for details.
@return An initialized raster tile source. @return An initialized raster tile source.
*/ */
@@ -122,14 +122,14 @@ MLN_EXPORT
guide for information about the format of a tile URL template. guide for information about the format of a tile URL template.
After initializing and configuring the source, add it to a map view’s style After initializing and configuring the source, add it to a map view’s style
using the `-[MLNStyle addSource:]` method. using the ``MLNStyle/addSource:`` method.
@param identifier A string that uniquely identifies the source in the style to @param identifier A string that uniquely identifies the source in the style to
which it is added. which it is added.
@param tileURLTemplates An array of tile URL template strings. Only the first @param tileURLTemplates An array of tile URL template strings. Only the first
string is used; any additional strings are ignored. string is used; any additional strings are ignored.
@param options A dictionary containing configuration options. See @param options A dictionary containing configuration options. See
`MLNTileSourceOption` for available keys and values. Pass in `nil` to use ``MLNTileSourceOption`` for available keys and values. Pass in `nil` to use
the default values. the default values.
@return An initialized tile source. @return An initialized tile source.
*/ */

View File

@@ -20,7 +20,7 @@ MLN_EXPORT
/** The name of the font family to use for client-side text rendering of CJK ideographs. /** The name of the font family to use for client-side text rendering of CJK ideographs.
Set MLNIdeographicFontFamilyName in your containing application's Info.plist to Set `MLNIdeographicFontFamilyName` in your containing application's Info.plist to
font family name(s) that will be available at run time, such as “PingFang TC” font family name(s) that will be available at run time, such as “PingFang TC”
or “Marker Felt”. This plist key accepts: or “Marker Felt”. This plist key accepts:

View File

@@ -24,7 +24,7 @@ typedef NS_ENUM(NSUInteger, MLNWellKnownTileServer) {
}; };
/** /**
The `MLNSettings` object provides a global way to set SDK properties such The ``MLNSettings`` object provides a global way to set SDK properties such
as apiKey, backend URL, etc. as apiKey, backend URL, etc.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -43,10 +43,10 @@ MLN_EXPORT
The API Key used by all instances of ``MLNMapView`` in the current application. The API Key used by all instances of ``MLNMapView`` in the current application.
Setting this property to a value of `nil` has no effect. Setting this property to a value of `nil` has no effect.
@note You must set the API key before attempting to load any style which > Note: You must set the API key before attempting to load any style which
requires the token. Therefore, you should generally set it before creating an instance of requires the token. Therefore, you should generally set it before creating an instance of
``MLNMapView``. The recommended way to set an api key is to add an entry ``MLNMapView``. The recommended way to set an api key is to add an entry
to your application’s Info.plist file with the key `MLNApiKey` to your application’s Info.plist file with the key `MLNApiKey``
and the type `String`. Alternatively, you may call this method from your and the type `String`. Alternatively, you may call this method from your
application delegate’s `-applicationDidFinishLaunching:` method. application delegate’s `-applicationDidFinishLaunching:` method.
*/ */

View File

@@ -6,7 +6,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface MLNSettings (Private) @interface MLNSettings (Private)
/// Returns the shared instance of the `MLNSettings` class. /// Returns the shared instance of the ``MLNSettings`` class.
@property (class, nonatomic, readonly) MLNSettings *sharedSettings; @property (class, nonatomic, readonly) MLNSettings *sharedSettings;
/// The current global access token. /// The current global access token.

View File

@@ -6,13 +6,13 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
`MLNShape` is an abstract class that represents a shape or annotation. Shapes ``MLNShape`` is an abstract class that represents a shape or annotation. Shapes
constitute the content of a map — not only the overlays atop the map, but also constitute the content of a map — not only the overlays atop the map, but also
the content that forms the base map. the content that forms the base map.
Create instances of `MLNPointAnnotation`, `MLNPointCollection`, `MLNPolyline`, Create instances of ``MLNPointAnnotation``, ``MLNPointAnnotation``, ``MLNPointAnnotation``,
`MLNMultiPolyline`, `MLNPolygon`, `MLNMultiPolygon`, or `MLNShapeCollection` in ``MLNMultiPolyline``, ``MLNMultiPolyline``, ``MLNMultiPolyline``, or ``MLNMultiPolyline`` in
order to use `MLNShape`'s methods. Do not create instances of `MLNShape` order to use ``MLNShape``'s methods. Do not create instances of ``MLNShape``
directly, and do not create your own subclasses of this class. The shape directly, and do not create your own subclasses of this class. The shape
classes correspond to the classes correspond to the
<a href="https://tools.ietf.org/html/rfc7946#section-3.1">Geometry</a> object <a href="https://tools.ietf.org/html/rfc7946#section-3.1">Geometry</a> object
@@ -20,20 +20,20 @@ NS_ASSUME_NONNULL_BEGIN
compatibility. compatibility.
Although you do not create instances of this class directly, you can use its Although you do not create instances of this class directly, you can use its
`+[MLNShape shapeWithData:encoding:error:]` factory method to create one of the ``MLNShape/shapeWithData:encoding:error:`` factory method to create one of the
concrete subclasses of `MLNShape` noted above from GeoJSON data. To access a concrete subclasses of ``MLNShape`` noted above from GeoJSON data. To access a
shape’s attributes, use the corresponding `MLNFeature` class instead. shape’s attributes, use the corresponding ``MLNFeature`` class instead.
You can add shapes to the map by adding them to an `MLNShapeSource` object. You can add shapes to the map by adding them to an ``MLNShapeSource`` object.
Configure the appearance of an `MLNShapeSource`’s or `MLNVectorTileSource`’s Configure the appearance of an ``MLNShapeSource``’s or ``MLNShapeSource``’s
shapes collectively using a concrete instance of `MLNVectorStyleLayer`. shapes collectively using a concrete instance of ``MLNVectorStyleLayer``.
Alternatively, you can add some kinds of shapes directly to a map view as Alternatively, you can add some kinds of shapes directly to a map view as
annotations or overlays. annotations or overlays.
You can filter the features in a `MLNVectorStyleLayer` or vary their layout or You can filter the features in a ``MLNVectorStyleLayer`` or vary their layout or
paint attributes based on the features’ geographies. Pass an `MLNShape` into an paint attributes based on the features’ geographies. Pass an ``MLNShape`` into an
`NSPredicate` with the format `SELF IN %@` or `%@ CONTAINS SELF` and set the `NSPredicate` with the format `SELF IN %@` or `%@ CONTAINS SELF` and set the
`MLNVectorStyleLayer.predicate` property to that predicate, or set a layout or ``MLNVectorStyleLayer/predicate`` property to that predicate, or set a layout or
paint attribute to a similarly formatted `NSExpression`. paint attribute to a similarly formatted `NSExpression`.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -42,14 +42,14 @@ MLN_EXPORT
// MARK: Creating a Shape // MARK: Creating a Shape
/** /**
Returns an `MLNShape` object initialized with the given data interpreted as a Returns an ``MLNShape`` object initialized with the given data interpreted as a
string containing a GeoJSON object. string containing a GeoJSON object.
If the GeoJSON object is a geometry, the returned value is a kind of If the GeoJSON object is a geometry, the returned value is a kind of
`MLNShape`. If it is a feature object, the returned value is a kind of ``MLNShape``. If it is a feature object, the returned value is a kind of
`MLNShape` that conforms to the `MLNFeature` protocol. If it is a feature ``MLNShape`` that conforms to the ``MLNShape`` protocol. If it is a feature
collection object, the returned value is an instance of collection object, the returned value is an instance of
`MLNShapeCollectionFeature`. ``MLNShapeCollectionFeature``.
### Example ### Example
@@ -64,7 +64,7 @@ MLN_EXPORT
@param encoding The encoding used by `data`. @param encoding The encoding used by `data`.
@param outError Upon return, if an error has occurred, a pointer to an @param outError Upon return, if an error has occurred, a pointer to an
`NSError` object describing the error. Pass in `NULL` to ignore any error. `NSError` object describing the error. Pass in `NULL` to ignore any error.
@return An `MLNShape` object representation of `data`, or `nil` if `data` could @return An ``MLNShape`` object representation of `data`, or `nil` if `data` could
not be parsed as valid GeoJSON source code. If `nil`, `outError` contains an not be parsed as valid GeoJSON source code. If `nil`, `outError` contains an
`NSError` object describing the problem. `NSError` object describing the problem.
*/ */
@@ -79,9 +79,9 @@ MLN_EXPORT
The default value of this property is `nil`. The default value of this property is `nil`.
This property is ignored when the shape is used in an `MLNShapeSource`. To name This property is ignored when the shape is used in an ``MLNShapeSource``. To name
a shape used in a shape source, create an `MLNFeature` and add an attribute to a shape used in a shape source, create an ``MLNFeature`` and add an attribute to
the `MLNFeature.attributes` property. the ``MLNFeature/attributes`` property.
*/ */
@property (nonatomic, copy, nullable) NSString *title; @property (nonatomic, copy, nullable) NSString *title;
@@ -89,9 +89,9 @@ MLN_EXPORT
The subtitle of the shape annotation. The default value of this property is The subtitle of the shape annotation. The default value of this property is
`nil`. `nil`.
This property is ignored when the shape is used in an `MLNShapeSource`. To This property is ignored when the shape is used in an ``MLNShapeSource``. To
provide additional information about a shape used in a shape source, create an provide additional information about a shape used in a shape source, create an
`MLNFeature` and add an attribute to the `MLNFeature.attributes` property. ``MLNFeature`` and add an attribute to the ``MLNFeature/attributes`` property.
*/ */
@property (nonatomic, copy, nullable) NSString *subtitle; @property (nonatomic, copy, nullable) NSString *subtitle;
@@ -102,7 +102,7 @@ MLN_EXPORT
The default value of this property is `nil`. The default value of this property is `nil`.
This property is ignored when the shape is used in an `MLNShapeSource`. This property is ignored when the shape is used in an ``MLNShapeSource``.
*/ */
@property (nonatomic, copy, nullable) NSString *toolTip; @property (nonatomic, copy, nullable) NSString *toolTip;

View File

@@ -8,27 +8,27 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
An `MLNShapeCollection` object represents a shape consisting of zero or more An ``MLNShapeCollection`` object represents a shape consisting of zero or more
distinct but related shapes that are instances of `MLNShape`. The constituent distinct but related shapes that are instances of ``MLNShape``. The constituent
shapes can be a mixture of different kinds of shapes. shapes can be a mixture of different kinds of shapes.
`MLNShapeCollection` is most commonly used to add multiple shapes to a single ``MLNShapeCollection`` is most commonly used to add multiple shapes to a single
`MLNShapeSource`. Configure the appearance of an `MLNShapeSource`’s or ``MLNShapeSource``. Configure the appearance of an ``MLNShapeSource``’s or
`MLNVectorTileSource`’s shape collection collectively using an ``MLNVectorTileSource``’s shape collection collectively using an
`MLNSymbolStyleLayer` object, or use multiple instances of ``MLNSymbolStyleLayer`` object, or use multiple instances of
`MLNCircleStyleLayer`, `MLNFillStyleLayer`, and `MLNLineStyleLayer` to ``MLNCircleStyleLayer``, ``MLNCircleStyleLayer``, and ``MLNCircleStyleLayer`` to
configure the appearance of each kind of shape inside the collection. configure the appearance of each kind of shape inside the collection.
You cannot add an `MLNShapeCollection` object directly to a map view as an You cannot add an ``MLNShapeCollection`` object directly to a map view as an
annotation. However, you can create individual `MLNPointAnnotation`, annotation. However, you can create individual ``MLNPointAnnotation``,
`MLNPolyline`, and `MLNPolygon` objects from the `shapes` array and add those ``MLNPolyline``, and ``MLNPolyline`` objects from the `shapes` array and add those
annotation objects to the map view using the `-[MLNMapView addAnnotations:]` annotation objects to the map view using the ``MLNMapView/addAnnotations:``
method. method.
To represent a collection of point, polyline, or polygon shapes, it may be more To represent a collection of point, polyline, or polygon shapes, it may be more
convenient to use an `MLNPointCollection`, `MLNMultiPolyline`, or convenient to use an ``MLNPointCollection``, ``MLNPointCollection``, or
`MLNMultiPolygon` object, respectively. To access a shape collection’s ``MLNMultiPolygon`` object, respectively. To access a shape collection’s
attributes, use the corresponding `MLNFeature` object. attributes, use the corresponding ``MLNFeature`` object.
A shape collection is known as a A shape collection is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.8">GeometryCollection</a> <a href="https://tools.ietf.org/html/rfc7946#section-3.1.8">GeometryCollection</a>

View File

@@ -39,14 +39,14 @@ MLN_EXPORT
/** /**
The minimum zoom level for which to download tiles and other resources. The minimum zoom level for which to download tiles and other resources.
For more information about zoom levels, `-[MLNMapView zoomLevel]`. For more information about zoom levels, ``MLNMapView/zoomLevel``.
*/ */
@property (nonatomic, readonly) double minimumZoomLevel; @property (nonatomic, readonly) double minimumZoomLevel;
/** /**
The maximum zoom level for which to download tiles and other resources. The maximum zoom level for which to download tiles and other resources.
For more information about zoom levels, `-[MLNMapView zoomLevel]`. For more information about zoom levels, ``MLNMapView/zoomLevel``.
*/ */
@property (nonatomic, readonly) double maximumZoomLevel; @property (nonatomic, readonly) double maximumZoomLevel;
@@ -56,7 +56,7 @@ MLN_EXPORT
Initializes a newly created offline region with the given style URL, geometry, Initializes a newly created offline region with the given style URL, geometry,
and range of zoom levels. and range of zoom levels.
This is the designated initializer for `MLNShapeOfflineRegion`. This is the designated initializer for ``MLNShapeOfflineRegion``.
@param styleURL URL of the map style for which to download resources. The URL @param styleURL URL of the map style for which to download resources. The URL
may be a full HTTP or HTTPS URL or a canonical URL. may be a full HTTP or HTTPS URL or a canonical URL.

View File

@@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
@class MLNShape; @class MLNShape;
/** /**
Options for `MLNShapeSource` objects. Options for ``MLNShapeSource`` objects.
*/ */
typedef NSString *MLNShapeSourceOption NS_STRING_ENUM; typedef NSString *MLNShapeSourceOption NS_STRING_ENUM;
@@ -24,13 +24,13 @@ typedef NSString *MLNShapeSourceOption NS_STRING_ENUM;
href="https://maplibre.org/maplibre-style-spec/#sources-geojson-cluster"><code>cluster</code></a> href="https://maplibre.org/maplibre-style-spec/#sources-geojson-cluster"><code>cluster</code></a>
source property in the MapLibre Style Spec. source property in the MapLibre Style Spec.
This option only affects point features within an `MLNShapeSource` object; it This option only affects point features within an ``MLNShapeSource`` object; it
is ignored when creating an `MLNComputedShapeSource` object. is ignored when creating an ``MLNComputedShapeSource`` object.
#### Related examples #### Related examples
TODO: Cluster point data TODO: Cluster point data
TODO: Use images to cluster point data TODO: Use images to cluster point data
Learn how to cluster point data with this `MLNShapeSourceOption`. Learn how to cluster point data with this ``MLNShapeSourceOption``.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClustered; FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClustered;
@@ -39,8 +39,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClus
cluster if clustering is enabled. A value of 512 produces a radius equal to cluster if clustering is enabled. A value of 512 produces a radius equal to
the width of a tile. The default value is 50. the width of a tile. The default value is 50.
This option only affects point features within an `MLNShapeSource` object; it This option only affects point features within an ``MLNShapeSource`` object; it
is ignored when creating an `MLNComputedShapeSource` object. is ignored when creating an ``MLNComputedShapeSource`` object.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClusterRadius; FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClusterRadius;
@@ -73,14 +73,14 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClus
href="https://maplibre.org/maplibre-style-spec/#sources-geojson-clusterProperties"><code>clusterProperties</code></a> href="https://maplibre.org/maplibre-style-spec/#sources-geojson-clusterProperties"><code>clusterProperties</code></a>
source property in the MapLibre Style Spec. source property in the MapLibre Style Spec.
This option only affects point features within an `MLNShapeSource` object; it This option only affects point features within an ``MLNShapeSource`` object; it
is ignored when creating an `MLNComputedShapeSource` object. is ignored when creating an ``MLNComputedShapeSource`` object.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClusterProperties; FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClusterProperties;
/** /**
An `NSNumber` object containing an integer; specifies the maximum zoom level at An `NSNumber` object containing an integer; specifies the maximum zoom level at
which to cluster points if clustering is enabled. Defaults to one zoom level which to cluster points if clustering is enabled. Defaults to one zoom level
less than the value of `MLNShapeSourceOptionMaximumZoomLevel` so that, at the less than the value of ``MLNShapeSourceOptionMaximumZoomLevel`` so that, at the
maximum zoom level, the shapes are not clustered. maximum zoom level, the shapes are not clustered.
This option corresponds to the This option corresponds to the
@@ -88,8 +88,8 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionClus
href="https://maplibre.org/maplibre-style-spec/#sources-geojson-clusterMaxZoom"><code>clusterMaxZoom</code></a> href="https://maplibre.org/maplibre-style-spec/#sources-geojson-clusterMaxZoom"><code>clusterMaxZoom</code></a>
source property in the MapLibre Style Spec. source property in the MapLibre Style Spec.
This option only affects point features within an `MLNShapeSource` object; it This option only affects point features within an ``MLNShapeSource`` object; it
is ignored when creating an `MLNComputedShapeSource` object. is ignored when creating an ``MLNComputedShapeSource`` object.
*/ */
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption
MLNShapeSourceOptionMaximumZoomLevelForClustering; MLNShapeSourceOptionMaximumZoomLevelForClustering;
@@ -144,7 +144,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionSimp
/** /**
An `NSNumber` object containing a Boolean enabling or disabling calculating line distance metrics. An `NSNumber` object containing a Boolean enabling or disabling calculating line distance metrics.
Set this property to `YES` in order for the `MLNLineStyleLayer.lineGradient` property to have its Set this property to `YES` in order for the ``MLNLineStyleLayer/lineGradient`` property to have its
intended effect. The default value is `NO`. intended effect. The default value is `NO`.
This option corresponds to the This option corresponds to the
@@ -155,25 +155,25 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionSimp
FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionLineDistanceMetrics; FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionLineDistanceMetrics;
/** /**
`MLNShapeSource` is a map content source that supplies vector shapes to be ``MLNShapeSource`` is a map content source that supplies vector shapes to be
shown on the map. The shapes may be instances of `MLNShape` or `MLNFeature`, shown on the map. The shapes may be instances of ``MLNShape`` or ``MLNShape``,
or they may be defined by local or external or they may be defined by local or external
<a href="http://geojson.org/">GeoJSON</a> code. A shape source is added to an <a href="http://geojson.org/">GeoJSON</a> code. A shape source is added to an
`MLNStyle` object along with an `MLNVectorStyleLayer` object. The vector style ``MLNStyle`` object along with an ``MLNStyle`` object. The vector style
layer defines the appearance of any content supplied by the shape source. You layer defines the appearance of any content supplied by the shape source. You
can update a shape source by setting its `shape` or `URL` property. can update a shape source by setting its `shape` or `URL` property.
`MLNShapeSource` is optimized for data sets that change dynamically and fit ``MLNShapeSource`` is optimized for data sets that change dynamically and fit
completely in memory. For large data sets that do not fit completely in memory, completely in memory. For large data sets that do not fit completely in memory,
use the `MLNComputedShapeSource` or `MLNVectorTileSource` class. use the ``MLNComputedShapeSource`` or ``MLNComputedShapeSource`` class.
Each Each
<a href="https://maplibre.org/maplibre-style-spec/#sources-geojson"><code>geojson</code></a> <a href="https://maplibre.org/maplibre-style-spec/#sources-geojson"><code>geojson</code></a>
source defined by the style JSON file is represented at runtime by an source defined by the style JSON file is represented at runtime by an
`MLNShapeSource` object that you can use to refine the map’s content and ``MLNShapeSource`` object that you can use to refine the map’s content and
initialize new style layers. You can also add and remove sources dynamically initialize new style layers. You can also add and remove sources dynamically
using methods such as `-[MLNStyle addSource:]` and using methods such as ``MLNStyle/addSource:`` and
`-[MLNStyle sourceWithIdentifier:]`. ``MLNStyle/sourceWithIdentifier:``.
Any vector style layer initialized with a shape source should have a `nil` Any vector style layer initialized with a shape source should have a `nil`
value in its `sourceLayerIdentifier` property. value in its `sourceLayerIdentifier` property.
@@ -194,7 +194,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNShapeSourceOption MLNShapeSourceOptionLine
TODO: Cluster point data TODO: Cluster point data
TODO: Use images to cluster point data TODO: Use images to cluster point data
TODO: Add live data TODO: Add live data
Learn how to add data to your map using this `MLNSource` object. Learn how to add data to your map using this ``MLNSource`` object.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNShapeSource : MLNSource @interface MLNShapeSource : MLNSource
@@ -205,12 +205,12 @@ MLN_EXPORT
Returns a shape source with an identifier, URL, and dictionary of options for Returns a shape source with an identifier, URL, and dictionary of options for
the source. the source.
This class supports the following options: `MLNShapeSourceOptionClustered`, This class supports the following options: ``MLNShapeSourceOptionClustered``,
`MLNShapeSourceOptionClusterRadius`, ``MLNShapeSourceOptionClusterRadius``,
`MLNShapeSourceOptionMaximumZoomLevelForClustering`, ``MLNShapeSourceOptionMaximumZoomLevelForClustering``,
`MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, ``MLNShapeSourceOptionMinimumZoomLevel``, ``MLNShapeSourceOptionMinimumZoomLevel``,
`MLNShapeSourceOptionBuffer`, and ``MLNShapeSourceOptionBuffer``, and
`MLNShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape ``MLNShapeSourceOptionSimplificationTolerance``. Shapes provided by a shape
source are not clipped or wrapped automatically. source are not clipped or wrapped automatically.
@param identifier A string that uniquely identifies the source. @param identifier A string that uniquely identifies the source.
@@ -221,7 +221,7 @@ MLN_EXPORT
#### Related examples #### Related examples
TODO: Add live data, learn how to add live data to your map by TODO: Add live data, learn how to add live data to your map by
updating the an `MLNShapeSource` object's `URL` property. updating the an ``MLNShapeSource`` object's `URL` property.
*/ */
- (instancetype)initWithIdentifier:(NSString *)identifier - (instancetype)initWithIdentifier:(NSString *)identifier
URL:(NSURL *)url URL:(NSURL *)url
@@ -232,32 +232,32 @@ MLN_EXPORT
Returns a shape source with an identifier, a shape, and dictionary of options Returns a shape source with an identifier, a shape, and dictionary of options
for the source. for the source.
This class supports the following options: `MLNShapeSourceOptionClustered`, This class supports the following options: ``MLNShapeSourceOptionClustered``,
`MLNShapeSourceOptionClusterRadius`, ``MLNShapeSourceOptionClusterRadius``,
`MLNShapeSourceOptionMaximumZoomLevelForClustering`, ``MLNShapeSourceOptionMaximumZoomLevelForClustering``,
`MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, ``MLNShapeSourceOptionMinimumZoomLevel``, ``MLNShapeSourceOptionMinimumZoomLevel``,
`MLNShapeSourceOptionBuffer`, and ``MLNShapeSourceOptionBuffer``, and
`MLNShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape ``MLNShapeSourceOptionSimplificationTolerance``. Shapes provided by a shape
source are not clipped or wrapped automatically. source are not clipped or wrapped automatically.
To specify attributes about the shape, use an instance of an `MLNShape` To specify attributes about the shape, use an instance of an ``MLNShape``
subclass that conforms to the `MLNFeature` protocol, such as `MLNPointFeature`. subclass that conforms to the ``MLNFeature`` protocol, such as ``MLNFeature``.
To include multiple shapes in the source, use an `MLNShapeCollection` or To include multiple shapes in the source, use an ``MLNShapeCollection`` or
`MLNShapeCollectionFeature` object, or use the ``MLNShapeCollectionFeature`` object, or use the
`-initWithIdentifier:features:options:` or `-initWithIdentifier:features:options:` or
`-initWithIdentifier:shapes:options:` methods. `-initWithIdentifier:shapes:options:` methods.
To create a shape from GeoJSON source code, use the To create a shape from GeoJSON source code, use the
`+[MLNShape shapeWithData:encoding:error:]` method. ``MLNShape/shapeWithData:encoding:error:`` method.
@param identifier A string that uniquely identifies the source. @param identifier A string that uniquely identifies the source.
@param shape A concrete subclass of `MLNShape` @param shape A concrete subclass of ``MLNShape``
@param options An `NSDictionary` of options for this source. @param options An `NSDictionary` of options for this source.
@return An initialized shape source. @return An initialized shape source.
#### Related examples #### Related examples
TODO: Animate a line, learn how to animate line data by continously TODO: Animate a line, learn how to animate line data by continously
updating an `MLNShapeSource`'s `shape` attribute. updating an ``MLNShapeSource``'s `shape` attribute.
*/ */
- (instancetype)initWithIdentifier:(NSString *)identifier - (instancetype)initWithIdentifier:(NSString *)identifier
shape:(nullable MLNShape *)shape shape:(nullable MLNShape *)shape
@@ -268,21 +268,21 @@ MLN_EXPORT
Returns a shape source with an identifier, an array of features, and a dictionary Returns a shape source with an identifier, an array of features, and a dictionary
of options for the source. of options for the source.
This class supports the following options: `MLNShapeSourceOptionClustered`, This class supports the following options: ``MLNShapeSourceOptionClustered``,
`MLNShapeSourceOptionClusterRadius`, ``MLNShapeSourceOptionClusterRadius``,
`MLNShapeSourceOptionMaximumZoomLevelForClustering`, ``MLNShapeSourceOptionMaximumZoomLevelForClustering``,
`MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, ``MLNShapeSourceOptionMinimumZoomLevel``, ``MLNShapeSourceOptionMinimumZoomLevel``,
`MLNShapeSourceOptionBuffer`, and ``MLNShapeSourceOptionBuffer``, and
`MLNShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape ``MLNShapeSourceOptionSimplificationTolerance``. Shapes provided by a shape
source are not clipped or wrapped automatically. source are not clipped or wrapped automatically.
Unlike `-initWithIdentifier:shapes:options:`, this method accepts `MLNFeature` Unlike `-initWithIdentifier:shapes:options:`, this method accepts ``MLNFeature``
instances, such as `MLNPointFeature` objects, whose attributes you can use when instances, such as ``MLNPointFeature`` objects, whose attributes you can use when
applying a predicate to `MLNVectorStyleLayer` or configuring a style layer’s applying a predicate to ``MLNVectorStyleLayer`` or configuring a style layer’s
appearance. appearance.
To create a shape from GeoJSON source code, use the To create a shape from GeoJSON source code, use the
`+[MLNShape shapeWithData:encoding:error:]` method. ``MLNShape/shapeWithData:encoding:error:`` method.
@param identifier A string that uniquely identifies the source. @param identifier A string that uniquely identifies the source.
@param features An array of objects that conform to the MLNFeature protocol. @param features An array of objects that conform to the MLNFeature protocol.
@@ -297,22 +297,22 @@ MLN_EXPORT
Returns a shape source with an identifier, an array of shapes, and a dictionary of Returns a shape source with an identifier, an array of shapes, and a dictionary of
options for the source. options for the source.
This class supports the following options: `MLNShapeSourceOptionClustered`, This class supports the following options: ``MLNShapeSourceOptionClustered``,
`MLNShapeSourceOptionClusterRadius`, ``MLNShapeSourceOptionClusterRadius``,
`MLNShapeSourceOptionMaximumZoomLevelForClustering`, ``MLNShapeSourceOptionMaximumZoomLevelForClustering``,
`MLNShapeSourceOptionMinimumZoomLevel`, `MLNShapeSourceOptionMaximumZoomLevel`, ``MLNShapeSourceOptionMinimumZoomLevel``, ``MLNShapeSourceOptionMinimumZoomLevel``,
`MLNShapeSourceOptionBuffer`, and ``MLNShapeSourceOptionBuffer``, and
`MLNShapeSourceOptionSimplificationTolerance`. Shapes provided by a shape ``MLNShapeSourceOptionSimplificationTolerance``. Shapes provided by a shape
source are not clipped or wrapped automatically. source are not clipped or wrapped automatically.
Any `MLNFeature` instance passed into this initializer is treated as an ordinary Any ``MLNFeature`` instance passed into this initializer is treated as an ordinary
shape, causing any attributes to be inaccessible to an `MLNVectorStyleLayer` when shape, causing any attributes to be inaccessible to an ``MLNVectorStyleLayer`` when
evaluating a predicate or configuring certain layout or paint attributes. To evaluating a predicate or configuring certain layout or paint attributes. To
preserve the attributes associated with each feature, use the preserve the attributes associated with each feature, use the
`-initWithIdentifier:features:options:` method instead. `-initWithIdentifier:features:options:` method instead.
To create a shape from GeoJSON source code, use the To create a shape from GeoJSON source code, use the
`+[MLNShape shapeWithData:encoding:error:]` method. ``MLNShape/shapeWithData:encoding:error:`` method.
@param identifier A string that uniquely identifies the source. @param identifier A string that uniquely identifies the source.
@param shapes An array of shapes; each shape is a member of a concrete subclass of MLNShape. @param shapes An array of shapes; each shape is a member of a concrete subclass of MLNShape.
@@ -331,7 +331,7 @@ MLN_EXPORT
If the receiver was initialized using `-initWithIdentifier:URL:options:`, this If the receiver was initialized using `-initWithIdentifier:URL:options:`, this
property is set to `nil`. This property is unavailable until the receiver is property is set to `nil`. This property is unavailable until the receiver is
passed into `-[MLNStyle addSource:]`. passed into ``MLNStyle/addSource:``.
You can get/set the shapes within a collection via this property. Actions must You can get/set the shapes within a collection via this property. Actions must
be performed on the application's main thread. be performed on the application's main thread.
@@ -364,14 +364,14 @@ MLN_EXPORT
Returned features may not necessarily be visible to the user at the time they Returned features may not necessarily be visible to the user at the time they
are loaded: the style may lack a layer that draws the features in question. To are loaded: the style may lack a layer that draws the features in question. To
obtain only _visible_ features, use the obtain only _visible_ features, use the
`-[MLNMapView visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:]` ``MLNMapView/visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:``
or or
`-[MLNMapView visibleFeaturesInRect:inStyleLayersWithIdentifiers:predicate:]` ``MLNMapView/visibleFeaturesInRect:inStyleLayersWithIdentifiers:predicate:``
method. method.
@param predicate A predicate to filter the returned features. Use `nil` to @param predicate A predicate to filter the returned features. Use `nil` to
include all features in the source. include all features in the source.
@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 source that match the predicate. represent features in the source that match the predicate.
*/ */
- (NSArray<id<MLNFeature>> *)featuresMatchingPredicate:(nullable NSPredicate *)predicate; - (NSArray<id<MLNFeature>> *)featuresMatchingPredicate:(nullable NSPredicate *)predicate;
@@ -383,12 +383,12 @@ MLN_EXPORT
This method supports pagination; you supply an offset (number of features to skip) This method supports pagination; you supply an offset (number of features to skip)
and a maximum number of features to return. and a maximum number of features to return.
@param cluster An object of type `MLNPointFeatureCluster` (that conforms to the `MLNCluster` @param cluster An object of type ``MLNPointFeatureCluster`` (that conforms to the
protocol). ``MLNPointFeatureCluster`` protocol).
@param offset Number of features to skip. @param offset Number of features to skip.
@param limit The maximum number of features to return @param limit The maximum number of features to return
@return An array of objects that conform to the `MLNFeature` protocol. @return An array of objects that conform to the ``MLNFeature`` protocol.
*/ */
- (NSArray<id<MLNFeature>> *)leavesOfCluster:(MLNPointFeatureCluster *)cluster - (NSArray<id<MLNFeature>> *)leavesOfCluster:(MLNPointFeatureCluster *)cluster
offset:(NSUInteger)offset offset:(NSUInteger)offset
@@ -397,24 +397,24 @@ MLN_EXPORT
/** /**
Returns an array of map features that are the immediate children of the specified Returns an array of map features that are the immediate children of the specified
cluster *on the next zoom level*. The may include features that also conform to cluster *on the next zoom level*. The may include features that also conform to
the `MLNCluster` protocol (currently only objects of type `MLNPointFeatureCluster`). the ``MLNCluster`` protocol (currently only objects of type ``MLNCluster``).
@param cluster An object of type `MLNPointFeatureCluster` (that conforms to the `MLNCluster` @param cluster An object of type ``MLNPointFeatureCluster`` (that conforms to the
protocol). ``MLNPointFeatureCluster`` protocol).
@return An array of objects that conform to the `MLNFeature` protocol. @return An array of objects that conform to the ``MLNFeature`` protocol.
@note The returned array may contain the `cluster` that was passed in, if the next > Note: The returned array may contain the `cluster` that was passed in, if the next
zoom level doesn't match the zoom level for expanding that cluster. See zoom level doesn't match the zoom level for expanding that cluster. See
`-[MLNShapeSource zoomLevelForExpandingCluster:]`. ``MLNShapeSource/zoomLevelForExpandingCluster:``.
*/ */
- (NSArray<id<MLNFeature>> *)childrenOfCluster:(MLNPointFeatureCluster *)cluster; - (NSArray<id<MLNFeature>> *)childrenOfCluster:(MLNPointFeatureCluster *)cluster;
/** /**
Returns the zoom level at which the given cluster expands. Returns the zoom level at which the given cluster expands.
@param cluster An object of type `MLNPointFeatureCluster` (that conforms to the `MLNCluster` @param cluster An object of type ``MLNPointFeatureCluster`` (that conforms to the
protocol). ``MLNPointFeatureCluster`` protocol).
@return Zoom level. This should be >= 0; any negative return value should be @return Zoom level. This should be >= 0; any negative return value should be
considered an error. considered an error.

View File

@@ -18,12 +18,12 @@ mbgl::Immutable<mbgl::style::GeoJSONOptions> MLNGeoJSONOptionsFromDictionary(
/** /**
:nodoc: :nodoc:
Debug log showing structure of an `MLNFeature`. This method recurses in the case Debug log showing structure of an ``MLNFeature``. This method recurses in the case
that the feature conforms to `MLNCluster`. This method is used for testing and that the feature conforms to ``MLNCluster``. This method is used for testing and
should be considered experimental, likely to be removed or changed in future should be considered experimental, likely to be removed or changed in future
releases. releases.
@param feature An object that conforms to the `MLNFeature` protocol. @param feature An object that conforms to the ``MLNFeature`` protocol.
@param indent Used during recursion. Specify 0. @param indent Used during recursion. Specify 0.
*/ */

View File

@@ -9,12 +9,12 @@ bool operator==(const CLLocationCoordinate2D lhs, const CLLocationCoordinate2D r
@interface MLNShape (Private) @interface MLNShape (Private)
/** /**
Returns an `mbgl::GeoJSON` representation of the `MLNShape`. Returns an `mbgl::GeoJSON` representation of the ``MLNShape``.
*/ */
- (mbgl::GeoJSON)geoJSONObject; - (mbgl::GeoJSON)geoJSONObject;
/** /**
Returns an `mbgl::Geometry<double>` representation of the `MLNShape`. Returns an `mbgl::Geometry<double>` representation of the ``MLNShape``.
*/ */
- (mbgl::Geometry<double>)geometryObject; - (mbgl::Geometry<double>)geometryObject;

View File

@@ -8,21 +8,21 @@ NS_ASSUME_NONNULL_BEGIN
FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidStyleSourceException; FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidStyleSourceException;
/** /**
`MLNSource` is an abstract base class for map content sources. A map content ``MLNSource`` is an abstract base class for map content sources. A map content
source supplies content to be shown on the map. A source is added to an source supplies content to be shown on the map. A source is added to an
`MLNStyle` object along with an `MLNForegroundStyleLayer` object. The ``MLNStyle`` object along with an ``MLNStyle`` object. The
foreground style layer defines the appearance of any content supplied by the foreground style layer defines the appearance of any content supplied by the
source. source.
Each source defined by the style JSON file is represented at runtime by an Each source defined by the style JSON file is represented at runtime by an
`MLNSource` object that you can use to refine the map’s content. You can also ``MLNSource`` object that you can use to refine the map’s content. You can also
add and remove sources dynamically using methods such as add and remove sources dynamically using methods such as
`-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. ``MLNStyle/addSource:`` and ``MLNStyle/sourceWithIdentifier:``.
Create instances of `MLNShapeSource`, `MLNComputedShapeSource`, Create instances of ``MLNShapeSource``, ``MLNShapeSource``,
`MLNImageSource`, and the concrete subclasses of `MLNTileSource` ``MLNImageSource``, and the concrete subclasses of ``MLNImageSource``
(``MLNVectorTileSource`` and `MLNRasterTileSource`) in order to use `MLNSource`’s (``MLNVectorTileSource`` and ``MLNRasterTileSource``) in order to use ``MLNRasterTileSource``’s
properties and methods. Do not create instances of `MLNSource` directly, and do properties and methods. Do not create instances of ``MLNSource`` directly, and do
not create your own subclasses of this class. not create your own subclasses of this class.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -36,7 +36,7 @@ MLN_EXPORT
Returns a source initialized with an identifier. Returns a source initialized with an identifier.
After initializing and configuring the source, add it to a map view’s style After initializing and configuring the source, add it to a map view’s style
using the `-[MLNStyle addSource:]` method. using the ``MLNStyle/addSource:`` method.
@param identifier A string that uniquely identifies the source in the style to @param identifier A string that uniquely identifies the source in the style to
which it is added. which it is added.

View File

@@ -24,7 +24,7 @@ struct SourceWrapper {
Assert that the style source is valid. Assert that the style source is valid.
This macro should be used at the beginning of any public-facing instance method This macro should be used at the beginning of any public-facing instance method
of `MLNSource` and its subclasses. For private methods, an assertion is more appropriate. of ``MLNSource`` and its subclasses. For private methods, an assertion is more appropriate.
*/ */
#define MLNAssertStyleSourceIsValid() \ #define MLNAssertStyleSourceIsValid() \
do { \ do { \
@@ -73,16 +73,16 @@ struct SourceWrapper {
Once a mbgl source is added, ownership of the object is transferred to the Once a mbgl source is added, ownership of the object is transferred to the
`mbgl::Map` and this object no longer has an active unique_ptr reference to the `mbgl::Map` and this object no longer has an active unique_ptr reference to the
`mbgl::Source`. If this object's mbgl source is in that state, the mbgl source `mbgl::Source`. If this object's mbgl source is in that state, the mbgl source
can still be changed but the changes will not be visible until the `MLNSource` can still be changed but the changes will not be visible until the ``MLNSource``
is added back to the map via `-[MLNStyle addSource:]` and styled with a is added back to the map via ``MLNStyle/addSource:`` and styled with a
`MLNLayer`. ``MLNLayer``.
*/ */
- (void)addToStylable:(id<MLNStylable>)mapView; - (void)addToStylable:(id<MLNStylable>)mapView;
/** /**
Removes the mbgl source that this object represents from the mbgl map. Removes the mbgl source that this object represents from the mbgl map.
When a mbgl source is removed, ownership of the object is transferred back When a mbgl source is removed, ownership of the object is transferred back
to the `MLNSource` instance and the unique_ptr reference is valid again. It is to the ``MLNSource`` instance and the unique_ptr reference is valid again. It is
safe to add the source back to the style after it is removed. safe to add the source back to the style after it is removed.
*/ */
- (BOOL)removeFromStylable:(id<MLNStylable>)mapView error:(NSError *__nullable *__nullable)outError; - (BOOL)removeFromStylable:(id<MLNStylable>)mapView error:(NSError *__nullable *__nullable)outError;

View File

@@ -27,12 +27,12 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNRedundantSourceIdentifier
with MapLibre. with MapLibre.
It is also possible to directly manipulate the current map style It is also possible to directly manipulate the current map style
via `MLNMapView.style` by updating the style's data sources or layers. via ``MLNMapView/style`` by updating the style's data sources or layers.
@note Wait until the map style has finished loading before modifying a map's > Note: Wait until the map style has finished loading before modifying a map's
style via any of the `MLNStyle` instance methods below. You can use the style via any of the ``MLNStyle`` instance methods below. You can use the
`-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or ``MLNMapViewDelegate/mapView:didFinishLoadingStyle:`` or
`-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` methods as indicators ``MLNMapViewDelegate/mapViewDidFinishLoadingMap:`` methods as indicators
that it's safe to modify the map's style. that it's safe to modify the map's style.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -93,15 +93,7 @@ MLN_EXPORT
/** /**
Returns a source with the given identifier in the current style. Returns a source with the given identifier in the current style.
@note Source identifiers are not guaranteed to exist across styles or different @return An instance of a concrete subclass of ``MLNSource`` associated with the
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 source identifer name changes that will occur in the default
style’s sources over time.
@return An instance of a concrete subclass of `MLNSource` associated with the
given identifier, or `nil` if the current style contains no such source. given identifier, or `nil` if the current style contains no such source.
*/ */
- (nullable MLNSource *)sourceWithIdentifier:(NSString *)identifier; - (nullable MLNSource *)sourceWithIdentifier:(NSString *)identifier;
@@ -109,14 +101,14 @@ MLN_EXPORT
/** /**
Adds a new source to the current style. Adds a new source to the current style.
@note Adding the same source instance more than once will result in a > Note: Adding the same source instance more than once will result in a
`MLNRedundantSourceException`. Reusing the same source identifier, even with ``MLNRedundantSourceException``. Reusing the same source identifier, even with
different source instances, will result in a different source instances, will result in a
`MLNRedundantSourceIdentifierException`. ``MLNRedundantSourceIdentifierException``.
@note Sources should be added in > Note: Sources should be added in
`-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or ``MLNMapViewDelegate/mapView:didFinishLoadingStyle:`` or
`-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map ``MLNMapViewDelegate/mapViewDidFinishLoadingMap:`` to ensure that the map
has loaded the style and is ready to accept a new source. has loaded the style and is ready to accept a new source.
@param source The source to add to the current style. @param source The source to add to the current style.
@@ -126,14 +118,6 @@ MLN_EXPORT
/** /**
Removes a source from the current style. Removes a source from the current style.
@note Source 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 source identifer name changes that will occur in the default
style’s sources over time.
@param source The source to remove from the current style. @param source The source to remove from the current style.
*/ */
- (void)removeSource:(MLNSource *)source; - (void)removeSource:(MLNSource *)source;
@@ -141,14 +125,6 @@ MLN_EXPORT
/** /**
Removes a source from the current style. Removes a source from the current style.
@note Source 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 source identifer name changes that will occur in the default
style’s sources over time.
@param source The source to remove from the current style. @param source The source to remove from the current style.
@param outError Upon return, if an error has occurred, a pointer to an `NSError` @param outError Upon return, if an error has occurred, a pointer to an `NSError`
object describing the error. Pass in `NULL` to ignore any error. object describing the error. Pass in `NULL` to ignore any error.
@@ -169,15 +145,7 @@ MLN_EXPORT
/** /**
Returns a style layer with the given identifier in the current style. Returns a style layer with the given identifier in the current style.
@note Layer identifiers are not guaranteed to exist across styles or different @return An instance of a concrete subclass of ``MLNStyleLayer`` associated with
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.
@return An instance of a concrete subclass of `MLNStyleLayer` associated with
the given identifier, or `nil` if the current style contains no such style the given identifier, or `nil` if the current style contains no such style
layer. layer.
*/ */
@@ -186,30 +154,30 @@ MLN_EXPORT
/** /**
Adds a new layer on top of existing layers. Adds a new layer on top of existing layers.
@note Adding the same layer instance more than once will result in a > Note: Adding the same layer instance more than once will result in a
`MLNRedundantLayerException`. Reusing the same layer identifer, even with ``MLNRedundantLayerException``. Reusing the same layer identifer, even with
different layer instances, will also result in an exception. different layer instances, will also result in an exception.
@note Layers should be added in > Note: Layers should be added in
`-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or ``MLNMapViewDelegate/mapView:didFinishLoadingStyle:`` or
`-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map ``MLNMapViewDelegate/mapViewDidFinishLoadingMap:`` to ensure that the map
has loaded the style and is ready to accept a new layer. has loaded the style and is ready to accept a new layer.
@param layer The layer object to add to the map view. This object must be an @param layer The layer object to add to the map view. This object must be an
instance of a concrete subclass of `MLNStyleLayer`. instance of a concrete subclass of ``MLNStyleLayer``.
*/ */
- (void)addLayer:(MLNStyleLayer *)layer; - (void)addLayer:(MLNStyleLayer *)layer;
/** /**
Inserts a new layer into the style at the given index. Inserts a new layer into the style at the given index.
@note Adding the same layer instance more than once will result in a > Note: Adding the same layer instance more than once will result in a
`MLNRedundantLayerException`. Reusing the same layer identifer, even with ``MLNRedundantLayerException``. Reusing the same layer identifer, even with
different layer instances, will also result in an exception. different layer instances, will also result in an exception.
@note Layers should be added in > Note: Layers should be added in
`-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or ``MLNMapViewDelegate/mapView:didFinishLoadingStyle:`` or
`-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map ``MLNMapViewDelegate/mapViewDidFinishLoadingMap:`` to ensure that the map
has loaded the style and is ready to accept a new layer. has loaded the style and is ready to accept a new layer.
@param layer The layer to insert. @param layer The layer to insert.
@@ -222,16 +190,8 @@ MLN_EXPORT
/** /**
Inserts a new layer below another layer. Inserts a new layer below another layer.
@note Layer identifiers are not guaranteed to exist across styles or different > Note: Inserting the same layer instance more than once will result in a
versions of the same style. Applications that use this API must first set ``MLNRedundantLayerException``. Reusing the same layer identifer, even with
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.
Inserting the same layer instance more than once will result in a
`MLNRedundantLayerException`. Reusing the same layer identifer, even with
different layer instances, will also result in an exception. different layer instances, will also result in an exception.
@param layer The layer to insert. @param layer The layer to insert.
@@ -246,16 +206,8 @@ MLN_EXPORT
/** /**
Inserts a new layer above another layer. Inserts a new layer above another layer.
@note Layer identifiers are not guaranteed to exist across styles or different > Note: Inserting the same layer instance more than once will result in a
versions of the same style. Applications that use this API must first set ``MLNRedundantLayerException``. Reusing the same layer identifer, even with
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.
Inserting the same layer instance more than once will result in a
`MLNRedundantLayerException`. Reusing the same layer identifer, even with
different layer instances, will also result in an exception. different layer instances, will also result in an exception.
@param layer The layer to insert. @param layer The layer to insert.
@@ -270,16 +222,8 @@ MLN_EXPORT
/** /**
Removes a layer from the map view. Removes a layer from the map view.
@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 layer The layer object to remove from the map view. This object @param layer The layer object to remove from the map view. This object
must conform to the `MLNStyleLayer` protocol. must conform to the ``MLNStyleLayer`` protocol.
*/ */
- (void)removeLayer:(MLNStyleLayer *)layer; - (void)removeLayer:(MLNStyleLayer *)layer;
@@ -288,14 +232,6 @@ MLN_EXPORT
/** /**
Returns the image associated with the given name in the style. Returns the image associated with the given name in the style.
@note Names and their associated images 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 image name changes that will
occur in the default style over time.
@param name The name associated with the image you want to obtain. @param name The name associated with the image you want to obtain.
@return The image associated with the given name, or `nil` if no image is @return The image associated with the given name, or `nil` if no image is
associated with that name. associated with that name.
@@ -306,7 +242,7 @@ MLN_EXPORT
Adds or overrides an image used by the style’s layers. Adds or overrides an image used by the style’s layers.
To use an image in a style layer, give it a unique name using this method, then To use an image in a style layer, give it a unique name using this method, then
set the `iconImageName` property of an `MLNSymbolStyleLayer` object to that set the `iconImageName` property of an ``MLNSymbolStyleLayer`` object to that
name. name.
@param image The image for the name. @param image The image for the name.
@@ -315,21 +251,13 @@ MLN_EXPORT
#### Related examples #### Related examples
TODO: Use images to cluster point data TODO: Use images to cluster point data
TODO: Cluster point data TODO: Cluster point data
Learn how to add images to your map using an `MLNStyle` object. Learn how to add images to your map using an ``MLNStyle`` object.
*/ */
- (void)setImage:(MLNImage *)image forName:(NSString *)name; - (void)setImage:(MLNImage *)image forName:(NSString *)name;
/** /**
Removes a name and its associated image from the style. Removes a name and its associated image from the style.
@note Names and their associated images 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 image name changes that will
occur in the default style over time.
@param name The name of the image to remove. @param name The name of the image to remove.
*/ */
- (void)removeImageForName:(NSString *)name; - (void)removeImageForName:(NSString *)name;
@@ -362,20 +290,13 @@ MLN_EXPORT
@end @end
/** /**
An object whose contents are represented by an `MLNStyle` object that you An object whose contents are represented by an ``MLNStyle`` object that you
configure. configure.
*/ */
@protocol MLNStylable <NSObject> @protocol MLNStylable <NSObject>
/** /**
The style currently displayed in the receiver. The style currently displayed in the receiver.
@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:]` or a manually constructed
`NSURL`.
*/ */
@property (nonatomic, readonly, nullable) MLNStyle *style; @property (nonatomic, readonly, nullable) MLNStyle *style;

View File

@@ -8,21 +8,21 @@ NS_ASSUME_NONNULL_BEGIN
FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidStyleLayerException; FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNInvalidStyleLayerException;
/** /**
`MLNStyleLayer` is an abstract base class for style layers. A style layer ``MLNStyleLayer`` is an abstract base class for style layers. A style layer
manages the layout and appearance of content at a specific z-index in a style. manages the layout and appearance of content at a specific z-index in a style.
An `MLNStyle` object consists of one or more `MLNStyleLayer` objects. An ``MLNStyle`` object consists of one or more ``MLNStyle`` objects.
Each style layer defined by the style JSON file is represented at runtime by an Each style layer defined by the style JSON file is represented at runtime by an
`MLNStyleLayer` object, which you can use to refine the map’s appearance. You ``MLNStyleLayer`` object, which you can use to refine the map’s appearance. You
can also add and remove style layers dynamically. can also add and remove style layers dynamically.
Create instances of `MLNBackgroundStyleLayer` and the concrete subclasses of Create instances of ``MLNBackgroundStyleLayer`` and the concrete subclasses of
`MLNForegroundStyleLayer` in order to use `MLNStyleLayer`'s properties and methods. ``MLNForegroundStyleLayer`` in order to use ``MLNForegroundStyleLayer``'s properties and methods.
You do not create instances of `MLNStyleLayer` directly, and do not You do not create instances of ``MLNStyleLayer`` directly, and do not
create your own subclasses of this class. create your own subclasses of this class.
Do not add `MLNStyleLayer` objects to the `style` property of a `MLNMapView` before Do not add ``MLNStyleLayer`` objects to the `style` property of a ``MLNStyleLayer`` before
`-mapView:didFinishLoadingStyle:` is called. ``MLNMapViewDelegate/mapView:didFinishLoadingStyle:`` is called.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNStyleLayer : NSObject @interface MLNStyleLayer : NSObject
@@ -46,7 +46,7 @@ MLN_EXPORT
Whether this layer is displayed. A value of `NO` hides the layer. Whether this layer is displayed. A value of `NO` hides the layer.
#### Related examples #### Related examples
TODO: Show and hide a layer, learn how to toggle an `MLNStyleLayer` TODO: Show and hide a layer, learn how to toggle an ``MLNStyleLayer``
object's visibility. object's visibility.
*/ */
@property (nonatomic, assign, getter=isVisible) BOOL visible; @property (nonatomic, assign, getter=isVisible) BOOL visible;

View File

@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
<%- propertyDoc(enumName(property), property, type, 'enum').wrap(80, 1) %> <%- propertyDoc(enumName(property), property, type, 'enum').wrap(80, 1) %>
Values of this type are used in the `MLN<%- camelize(type) %>StyleLayer.<%- camelizeWithLeadingLowercase(property.name) %>` Values of this type are used in the ``MLN<%- camelize(type) %>StyleLayer/<%- camelizeWithLeadingLowercase(property.name) %>``
property. property.
*/ */
typedef NS_ENUM(NSUInteger, MLN<%- camelize(enumName(property)) %>) { typedef NS_ENUM(NSUInteger, MLN<%- camelize(enumName(property)) %>) {
@@ -42,7 +42,7 @@ typedef NS_ENUM(NSUInteger, MLN<%- camelize(enumName(property)) %>) {
/** /**
<%- propertyDoc(enumName(property), property, type, 'enum').wrap(80, 1) %> <%- propertyDoc(enumName(property), property, type, 'enum').wrap(80, 1) %>
Values of this type are used in the `MLN<%- camelize(type) %>StyleLayer.<%- camelizeWithLeadingLowercase(enumName(property)) %>` Values of this type are used in the ``MLN<%- camelize(type) %>StyleLayer/<%- camelizeWithLeadingLowercase(enumName(property)) %>``
property. property.
*/ */
typedef NS_ENUM(NSUInteger, MLN<%- camelize(enumName(property)) %>) { typedef NS_ENUM(NSUInteger, MLN<%- camelize(enumName(property)) %>) {
@@ -65,10 +65,10 @@ typedef NS_ENUM(NSUInteger, MLN<%- camelize(enumName(property)) %>) {
<%- doc.wrap(80, 1) %> <%- doc.wrap(80, 1) %>
You can access an existing <%- type %> style layer using the You can access an existing <%- type %> style layer using the
`-[MLNStyle layerWithIdentifier:]` method if you know its identifier; ``MLNStyle/layerWithIdentifier:`` method if you know its identifier;
otherwise, find it using the `MLNStyle.layers` property. You can also create a otherwise, find it using the ``MLNStyle/layers`` property. You can also create a
new <%- type %> style layer and add it to the style using a method such as new <%- type %> style layer and add it to the style using a method such as
`-[MLNStyle addLayer:]`. ``MLNStyle/addLayer:``.
<% if (examples) { -%> <% if (examples) { -%>
#### Related examples #### Related examples
@@ -93,8 +93,8 @@ MLN_EXPORT
Returns a <%- type %> style layer initialized with an identifier. Returns a <%- type %> style layer initialized with an identifier.
After initializing and configuring the style layer, add it to a map view’s After initializing and configuring the style layer, add it to a map view’s
style using the `-[MLNStyle addLayer:]` or style using the ``MLNStyle/addLayer:`` or
`-[MLNStyle insertLayer:belowLayer:]` method. ``MLNStyle/insertLayer:belowLayer:`` method.
@param identifier A string that uniquely identifies the source in the style to @param identifier A string that uniquely identifies the source in the style to
which it is added. which it is added.
@@ -106,8 +106,8 @@ which it is added.
Returns a <%- type %> style layer initialized with an identifier and source. Returns a <%- type %> style layer initialized with an identifier and source.
After initializing and configuring the style layer, add it to a map view’s After initializing and configuring the style layer, add it to a map view’s
style using the `-[MLNStyle addLayer:]` or style using the ``MLNStyle/addLayer:`` or
`-[MLNStyle insertLayer:belowLayer:]` method. ``MLNStyle/insertLayer:belowLayer:`` method.
@param identifier A string that uniquely identifies the source in the style to @param identifier A string that uniquely identifies the source in the style to
which it is added. which it is added.
@@ -172,7 +172,7 @@ which it is added.
<% if (enumProperties) { -%> <% if (enumProperties) { -%>
/** /**
Methods for wrapping an enumeration value for a style layer attribute in an Methods for wrapping an enumeration value for a style layer attribute in an
`MLN<%- camelize(type) %>StyleLayer` object and unwrapping its raw value. ``MLN<%- camelize(type) %>StyleLayer`` object and unwrapping its raw value.
*/ */
@interface NSValue (MLN<%- camelize(type) %>StyleLayerAdditions) @interface NSValue (MLN<%- camelize(type) %>StyleLayerAdditions)
@@ -188,7 +188,7 @@ which it is added.
+ (instancetype)valueWithMLN<%- camelize(enumName(property)) %>:(MLN<%- camelize(enumName(property)) %>)<%- objCName(property) %>; + (instancetype)valueWithMLN<%- camelize(enumName(property)) %>:(MLN<%- camelize(enumName(property)) %>)<%- objCName(property) %>;
/** /**
The `MLN<%- camelize(enumName(property)) %>` enumeration representation of the value. The ``MLN<%- camelize(enumName(property)) %>`` enumeration representation of the value.
*/ */
@property (readonly) MLN<%- camelize(enumName(property)) %> MLN<%- camelize(enumName(property)) %>Value; @property (readonly) MLN<%- camelize(enumName(property)) %> MLN<%- camelize(enumName(property)) %>Value;

View File

@@ -20,7 +20,7 @@ struct LayerWrapper {
Assert that the style layer is valid. Assert that the style layer is valid.
This macro should be used at the beginning of any public-facing instance method This macro should be used at the beginning of any public-facing instance method
of `MLNStyleLayer` and its subclasses. For private methods, an assertion is more appropriate. of ``MLNStyleLayer`` and its subclasses. For private methods, an assertion is more appropriate.
*/ */
#define MLNAssertStyleLayerIsValid() \ #define MLNAssertStyleLayerIsValid() \
do { \ do { \
@@ -77,7 +77,7 @@ struct LayerWrapper {
Removes the mbgl style layer that this object represents from the mbgl map. Removes the mbgl style layer that this object represents from the mbgl map.
When a mbgl style layer is removed, ownership of the object is transferred back When a mbgl style layer is removed, ownership of the object is transferred back
to the `MLNStyleLayer` instance and the unique_ptr reference is valid again. It to the ``MLNStyleLayer`` instance and the unique_ptr reference is valid again. It
is safe to add the layer back to the style after it is removed. is safe to add the layer back to the style after it is removed.
*/ */
- (void)removeFromStyle:(MLNStyle *)style; - (void)removeFromStyle:(MLNStyle *)style;

View File

@@ -40,14 +40,14 @@ MLN_EXPORT
/** /**
The minimum zoom level for which to download tiles and other resources. The minimum zoom level for which to download tiles and other resources.
For more information about zoom levels, `-[MLNMapView zoomLevel]`. For more information about zoom levels, ``MLNMapView/zoomLevel``.
*/ */
@property (nonatomic, readonly) double minimumZoomLevel; @property (nonatomic, readonly) double minimumZoomLevel;
/** /**
The maximum zoom level for which to download tiles and other resources. The maximum zoom level for which to download tiles and other resources.
For more information about zoom levels, `-[MLNMapView zoomLevel]`. For more information about zoom levels, ``MLNMapView/zoomLevel``.
*/ */
@property (nonatomic, readonly) double maximumZoomLevel; @property (nonatomic, readonly) double maximumZoomLevel;
@@ -57,7 +57,7 @@ MLN_EXPORT
Initializes a newly created offline region with the given style URL, geographic Initializes a newly created offline region with the given style URL, geographic
coordinate bounds, and range of zoom levels. coordinate bounds, and range of zoom levels.
This is the designated initializer for `MLNTilePyramidOfflineRegion`. This is the designated initializer for ``MLNTilePyramidOfflineRegion``.
@param styleURL URL of the map style for which to download resources. The URL @param styleURL URL of the map style for which to download resources. The URL
may be a full HTTP or HTTPS URL or a canonical style URL. may be a full HTTP or HTTPS URL or a canonical style URL.

View File

@@ -6,7 +6,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNTileServerOptions` defines server properties such as URL etc... The ``MLNTileServerOptions`` defines server properties such as URL etc...
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNTileServerOptions : NSObject @interface MLNTileServerOptions : NSObject

View File

@@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
@class MLNAttributionInfo; @class MLNAttributionInfo;
/** /**
Options for `MLNTileSource` objects. Options for ``MLNTileSource`` objects.
*/ */
typedef NSString *MLNTileSourceOption NS_STRING_ENUM; typedef NSString *MLNTileSourceOption NS_STRING_ENUM;
@@ -18,7 +18,7 @@ typedef NSString *MLNTileSourceOption NS_STRING_ENUM;
zoom level at which to display tiles from the source. zoom level at which to display tiles from the source.
The value should be between 0 and 22, inclusive, and less than The value should be between 0 and 22, inclusive, and less than
`MLNTileSourceOptionMaximumZoomLevel`, if specified. The default value for this ``MLNTileSourceOptionMaximumZoomLevel``, if specified. The default value for this
option is 0. option is 0.
This option corresponds to the `minzoom` key in the This option corresponds to the `minzoom` key in the
@@ -32,7 +32,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionMinimu
zoom level at which to display tiles from the source. zoom level at which to display tiles from the source.
The value should be between 0 and 22, inclusive, and less than The value should be between 0 and 22, inclusive, and less than
`MLNTileSourceOptionMinimumZoomLevel`, if specified. The default value for this ``MLNTileSourceOptionMinimumZoomLevel``, if specified. The default value for this
option is 22. option is 22.
This option corresponds to the `maxzoom` key in the This option corresponds to the `maxzoom` key in the
@@ -42,7 +42,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionMinimu
FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionMaximumZoomLevel; FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionMaximumZoomLevel;
/** /**
An `NSValue` object containing an `MLNCoordinateBounds` struct that specifies An `NSValue` object containing an ``MLNCoordinateBounds`` struct that specifies
the geographic extent of the source. the geographic extent of the source.
If this option is specified, the SDK avoids requesting any tile that falls If this option is specified, the SDK avoids requesting any tile that falls
@@ -62,7 +62,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionCoordi
pressed. pressed.
By default, no attribution statements are displayed. If the By default, no attribution statements are displayed. If the
`MLNTileSourceOptionAttributionInfos` option is specified, this option is ``MLNTileSourceOptionAttributionInfos`` option is specified, this option is
ignored. ignored.
This option corresponds to the `attribution` key in the This option corresponds to the `attribution` key in the
@@ -72,7 +72,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionCoordi
FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttributionHTMLString; FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttributionHTMLString;
/** /**
An array of `MLNAttributionInfo` objects defining the buttons to be displayed An array of ``MLNAttributionInfo`` objects defining the buttons to be displayed
in an action sheet when the source is part of a map view’s style and the map in an action sheet when the source is part of a map view’s style and the map
view’s attribution button is pressed. view’s attribution button is pressed.
@@ -85,7 +85,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttrib
attribution view when the source is part of the map view’s style. attribution view when the source is part of the map view’s style.
By default, no attribution statements are displayed. If the By default, no attribution statements are displayed. If the
`MLNTileSourceOptionAttributionInfos` option is specified, this option is ``MLNTileSourceOptionAttributionInfos`` option is specified, this option is
ignored. ignored.
This option corresponds to the `attribution` key in the This option corresponds to the `attribution` key in the
@@ -95,7 +95,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttrib
FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttributionHTMLString; FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttributionHTMLString;
/** /**
An array of `MLNAttributionInfo` objects defining the buttons to be displayed An array of ``MLNAttributionInfo`` objects defining the buttons to be displayed
in the map view’s attribution view when the source is part of the map view’s in the map view’s attribution view when the source is part of the map view’s
style. style.
@@ -107,9 +107,9 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNTileSourceOption MLNTileSourceOptionAttrib
/** /**
An `NSNumber` object containing an unsigned integer that specifies the tile An `NSNumber` object containing an unsigned integer that specifies the tile
coordinate system for the source’s tile URLs. The integer corresponds to one of coordinate system for the source’s tile URLs. The integer corresponds to one of
the constants described in `MLNTileCoordinateSystem`. the constants described in ``MLNTileCoordinateSystem``.
The default value for this option is `MLNTileCoordinateSystemXYZ`. The default value for this option is ``MLNTileCoordinateSystem/MLNTileCoordinateSystemXYZ``.
This option corresponds to the `scheme` key in the This option corresponds to the `scheme` key in the
<a href="https://github.com/mapbox/tilejson-spec/tree/master/2.1.0">TileJSON</a> <a href="https://github.com/mapbox/tilejson-spec/tree/master/2.1.0">TileJSON</a>
@@ -162,21 +162,21 @@ typedef NS_ENUM(NSUInteger, MLNDEMEncoding) {
}; };
/** /**
`MLNTileSource` is a map content source that supplies map tiles to be shown on ``MLNTileSource`` is a map content source that supplies map tiles to be shown on
the map. The location of and metadata about the tiles are defined either by an the map. The location of and metadata about the tiles are defined either by an
option dictionary or by an external file that conforms to the option dictionary or by an external file that conforms to the
<a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>. <a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>.
A tile source is added to an `MLNStyle` object along with one or more A tile source is added to an ``MLNStyle`` object along with one or more
`MLNRasterStyleLayer` or `MLNVectorStyleLayer` objects. Use a style layer to ``MLNRasterStyleLayer`` or ``MLNRasterStyleLayer`` objects. Use a style layer to
control the appearance of content supplied by the tile source. control the appearance of content supplied by the tile source.
A tile source is also known as a tile set. To learn about the structure of a A tile source is also known as a tile set. To learn about the structure of a
Mapbox-hosted tile set, view it in Mapbox-hosted tile set, view it in
<a href="https://www.mapbox.com/studio/tilesets/">Mapbox Studio’s Tilesets editor</a>. <a href="https://www.mapbox.com/studio/tilesets/">Mapbox Studio’s Tilesets editor</a>.
Create instances of `MLNRasterTileSource` and `MLNVectorTileSource` in order Create instances of ``MLNRasterTileSource`` and ``MLNRasterTileSource`` in order
to use `MLNTileSource`'s properties and methods. Do not create instances of to use ``MLNTileSource``'s properties and methods. Do not create instances of
`MLNTileSource` directly, and do not create your own subclasses of this class. ``MLNTileSource`` directly, and do not create your own subclasses of this class.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNTileSource : MLNSource @interface MLNTileSource : MLNSource
@@ -195,7 +195,7 @@ MLN_EXPORT
// MARK: Accessing Attribution Strings // MARK: Accessing Attribution Strings
/** /**
An array of `MLNAttributionInfo` objects that define the attribution An array of ``MLNAttributionInfo`` objects that define the attribution
statements to be displayed when the map is shown to the user. statements to be displayed when the map is shown to the user.
By default, this array is empty. If the source is initialized with a By default, this array is empty. If the source is initialized with a

View File

@@ -62,7 +62,7 @@ typedef NS_ENUM(NSInteger, MLNErrorCode) {
MLNErrorCodeRenderingError = 11, MLNErrorCodeRenderingError = 11,
}; };
/** Options for enabling debugging features in an `MLNMapView` instance. */ /** Options for enabling debugging features in an ``MLNMapView`` instance. */
typedef NS_OPTIONS(NSUInteger, MLNMapDebugMaskOptions) { typedef NS_OPTIONS(NSUInteger, MLNMapDebugMaskOptions) {
/** Edges of tile boundaries are shown as thick, red lines to help diagnose /** Edges of tile boundaries are shown as thick, red lines to help diagnose
tile clipping issues. */ tile clipping issues. */
@@ -76,14 +76,14 @@ typedef NS_OPTIONS(NSUInteger, MLNMapDebugMaskOptions) {
MLNMapDebugCollisionBoxesMask = 1 << 4, MLNMapDebugCollisionBoxesMask = 1 << 4,
/** Each drawing operation is replaced by a translucent fill. Overlapping /** Each drawing operation is replaced by a translucent fill. Overlapping
drawing operations appear more prominent to help diagnose overdrawing. drawing operations appear more prominent to help diagnose overdrawing.
@note This option does nothing in Release builds of the SDK. */ > Note: This option does nothing in Release builds of the SDK. */
MLNMapDebugOverdrawVisualizationMask = 1 << 5, MLNMapDebugOverdrawVisualizationMask = 1 << 5,
#if !TARGET_OS_IPHONE #if !TARGET_OS_IPHONE
/** The stencil buffer is shown instead of the color buffer. /** The stencil buffer is shown instead of the color buffer.
@note This option does nothing in Release builds of the SDK. */ > Note: This option does nothing in Release builds of the SDK. */
MLNMapDebugStencilBufferMask = 1 << 6, MLNMapDebugStencilBufferMask = 1 << 6,
/** The depth buffer is shown instead of the color buffer. /** The depth buffer is shown instead of the color buffer.
@note This option does nothing in Release builds of the SDK. */ > Note: This option does nothing in Release builds of the SDK. */
MLNMapDebugDepthBufferMask = 1 << 7, MLNMapDebugDepthBufferMask = 1 << 7,
#endif #endif
}; };
@@ -109,14 +109,14 @@ NS_INLINE NSString *MLNStringFromMLNTransition(MLNTransition transition) {
} }
/** /**
Creates a new `MLNTransition` from the given duration and delay. Creates a new ``MLNTransition`` from the given duration and delay.
@param duration The amount of time the animation should take, not including @param duration The amount of time the animation should take, not including
the delay. the delay.
@param delay The amount of time in seconds to wait before beginning the @param delay The amount of time in seconds to wait before beginning the
animation. animation.
@return Returns a `MLNTransition` struct containing the transition attributes. @return Returns a ``MLNTransition`` struct containing the transition attributes.
*/ */
NS_INLINE MLNTransition MLNTransitionMake(NSTimeInterval duration, NSTimeInterval delay) { NS_INLINE MLNTransition MLNTransitionMake(NSTimeInterval duration, NSTimeInterval delay) {
MLNTransition transition; MLNTransition transition;

View File

@@ -6,13 +6,13 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
`MLNVectorStyleLayer` is an abstract superclass for style layers whose content ``MLNVectorStyleLayer`` is an abstract superclass for style layers whose content
is defined by an `MLNShapeSource` or `MLNVectorTileSource` object. is defined by an ``MLNShapeSource`` or ``MLNShapeSource`` object.
Create instances of `MLNCircleStyleLayer`, `MLNFillStyleLayer`, Create instances of ``MLNCircleStyleLayer``, ``MLNCircleStyleLayer``,
`MLNFillExtrusionStyleLayer`, `MLNHeatmapStyleLayer`, `MLNLineStyleLayer`, and ``MLNFillExtrusionStyleLayer``, ``MLNFillExtrusionStyleLayer``, ``MLNFillExtrusionStyleLayer``, and
`MLNSymbolStyleLayer` in order to use `MLNVectorStyleLayer`'s properties and ``MLNSymbolStyleLayer`` in order to use ``MLNSymbolStyleLayer``'s properties and
methods. Do not create instances of `MLNVectorStyleLayer` directly, and do not methods. Do not create instances of ``MLNVectorStyleLayer`` directly, and do not
create your own subclasses of this class. create your own subclasses of this class.
*/ */
MLN_EXPORT MLN_EXPORT

View File

@@ -5,29 +5,29 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
`MLNVectorTileSource` is a map content source that supplies tiled vector data ``MLNVectorTileSource`` is a map content source that supplies tiled vector data
in <a href="https://www.mapbox.com/vector-tiles/">Mapbox Vector Tile</a> format in <a href="https://www.mapbox.com/vector-tiles/">Mapbox Vector Tile</a> format
to be shown on the map. The location of and metadata about the tiles are to be shown on the map. The location of and metadata about the tiles are
defined either by an option dictionary or by an external file that conforms to defined either by an option dictionary or by an external file that conforms to
the the
<a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>. <a href="https://github.com/mapbox/tilejson-spec/">TileJSON specification</a>.
A vector tile source is added to an `MLNStyle` object along with one or more A vector tile source is added to an ``MLNStyle`` object along with one or more
`MLNVectorStyleLayer` objects. A vector style layer defines the appearance of ``MLNVectorStyleLayer`` objects. A vector style layer defines the appearance of
any content supplied by the vector tile source. any content supplied by the vector tile source.
`MLNVectorTileSource` is optimized for data sets that are too large to fit ``MLNVectorTileSource`` is optimized for data sets that are too large to fit
completely in memory, such as vector tile sets or data sets managed in completely in memory, such as vector tile sets or data sets managed in
<a href="https://www.mapbox.com/studio/">Mapbox Studio</a>. For <a href="https://www.mapbox.com/studio/">Mapbox Studio</a>. For
<a href="http://geojson.org/">GeoJSON</a> data, use the `MLNShapeSource` <a href="http://geojson.org/">GeoJSON</a> data, use the ``MLNShapeSource``
class. For tiled data that changes dynamically, the `MLNComputedShapeSource` class. For tiled data that changes dynamically, the ``MLNComputedShapeSource``
class may be a suitable alternative. class may be a suitable alternative.
Each Each
<a href="https://maplibre.org/maplibre-style-spec/sources/#vector"><code>vector</code></a> <a href="https://maplibre.org/maplibre-style-spec/sources/#vector"><code>vector</code></a>
source defined by the style JSON file is represented at runtime by an source defined by the style JSON file is represented at runtime by an
`MLNVectorTileSource` object that you can use to initialize new style layers. ``MLNVectorTileSource`` object that you can use to initialize new style layers.
You can also add and remove sources dynamically using methods such as You can also add and remove sources dynamically using methods such as
`-[MLNStyle addSource:]` and `-[MLNStyle sourceWithIdentifier:]`. ``MLNStyle/addSource:`` and ``MLNStyle/sourceWithIdentifier:``.
Within each vector tile, each geometric coordinate must lie between Within each vector tile, each geometric coordinate must lie between
−1&nbsp;×&nbsp;<var>extent</var> and −1&nbsp;×&nbsp;<var>extent</var> and
@@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN
#### Related examples #### Related examples
TODO: Data-driven circles, learn how to add data to your map using TODO: Data-driven circles, learn how to add data to your map using
an `MLNVectorTileSource` object. an ``MLNVectorTileSource`` object.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNVectorTileSource : MLNTileSource @interface MLNVectorTileSource : MLNTileSource
@@ -69,7 +69,7 @@ MLN_EXPORT
URL. URL.
After initializing and configuring the source, add it to a map view’s style After initializing and configuring the source, add it to a map view’s style
using the `-[MLNStyle addSource:]` method. using the ``MLNStyle/addSource:`` method.
The URL may be a full HTTP or HTTPS URL or a canonical The URL may be a full HTTP or HTTPS URL or a canonical
URL. The URL should point to a JSON file that conforms to the URL. The URL should point to a JSON file that conforms to the
@@ -93,14 +93,14 @@ MLN_EXPORT
guide for information about the format of a tile URL template. guide for information about the format of a tile URL template.
After initializing and configuring the source, add it to a map view’s style After initializing and configuring the source, add it to a map view’s style
using the `-[MLNStyle addSource:]` method. using the ``MLNStyle/addSource:`` method.
@param identifier A string that uniquely identifies the source in the style to @param identifier A string that uniquely identifies the source in the style to
which it is added. which it is added.
@param tileURLTemplates An array of tile URL template strings. Only the first @param tileURLTemplates An array of tile URL template strings. Only the first
string is used; any additional strings are ignored. string is used; any additional strings are ignored.
@param options A dictionary containing configuration options. See @param options A dictionary containing configuration options. See
`MLNTileSourceOption` for available keys and values. Pass in `nil` to use ``MLNTileSourceOption`` for available keys and values. Pass in `nil` to use
the default values. the default values.
@return An initialized tile source. @return An initialized tile source.
*/ */
@@ -117,7 +117,7 @@ MLN_EXPORT
Each object in the returned array represents a feature loaded by the source and Each object in the returned array represents a feature loaded by the source and
provides access to attributes specified as part of the loaded feature. The provides access to attributes specified as part of the loaded feature. The
source loads a feature if the source is added to an `MLNMapView`’s style; that source loads a feature if the source is added to an ``MLNMapView``’s style; that
style has a layer that uses the source; and the map view has recently scrolled style has a layer that uses the source; and the map view has recently scrolled
to the region containing the feature. to the region containing the feature.
@@ -133,9 +133,9 @@ MLN_EXPORT
are loaded: the style may contain a layer that forces the source’s tiles to are loaded: the style may contain a layer that forces the source’s tiles to
load but filters out the features in question, preventing them from being load but filters out the features in question, preventing them from being
drawn. To obtain only _visible_ features, use the drawn. To obtain only _visible_ features, use the
`-[MLNMapView visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:]` ``MLNMapView/visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:``
or or
`-[MLNMapView visibleFeaturesInRect:inStyleLayersWithIdentifiers:predicate:]` ``MLNMapView/visibleFeaturesInRect:inStyleLayersWithIdentifiers:predicate:``
method. method.
@param sourceLayerIdentifiers The source layers to include in the query. Only @param sourceLayerIdentifiers The source layers to include in the query. Only
@@ -143,7 +143,7 @@ MLN_EXPORT
array. This array may not be empty. array. This array may not be empty.
@param predicate A predicate to filter the returned features. Use `nil` to @param predicate A predicate to filter the returned features. Use `nil` to
include all loaded features. include all loaded 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 loaded by the source that match the predicate. represent features loaded by the source that match the predicate.
*/ */
- (NSArray<id<MLNFeature>> *)featuresInSourceLayersWithIdentifiers: - (NSArray<id<MLNFeature>> *)featuresInSourceLayersWithIdentifiers:

View File

@@ -95,7 +95,7 @@ static NSArray * const MLNMapboxStreetsLanguages = @[
]; ];
/** /**
Like `MLNMapboxStreetsLanguages`, but deanglicized for use with Like ``MLNMapboxStreetsLanguages``, but deanglicized for use with
`+[NSBundle preferredLocalizationsFromArray:forPreferences:]`. `+[NSBundle preferredLocalizationsFromArray:forPreferences:]`.
*/ */
static NSArray * const MLNMapboxStreetsAlternativeLanguages = @[ static NSArray * const MLNMapboxStreetsAlternativeLanguages = @[

View File

@@ -152,14 +152,14 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode
parameters and steps. parameters and steps.
@param inputExpression The interpolating expression input. @param inputExpression The interpolating expression input.
@param curveType The curve type could be `MLNExpressionInterpolationModeLinear`, @param curveType The curve type could be ``MLNExpressionInterpolationModeLinear``,
`MLNExpressionInterpolationModeExponential` and ``MLNExpressionInterpolationModeExponential`` and
`MLNExpressionInterpolationModeCubicBezier`. ``MLNExpressionInterpolationModeCubicBezier``.
@param parameters The parameters expression. @param parameters The parameters expression.
@param stops The stops expression. @param stops The stops expression.
#### Related examples #### Related examples
TODO: Create a heatmap layer, learn how to style an `MLNHeatmapStyleLayer` TODO: Create a heatmap layer, learn how to style an ``MLNHeatmapStyleLayer``
based on zoom level and point density with this expression. based on zoom level and point density with this expression.
*/ */
+ (instancetype)mgl_expressionForInterpolatingExpression:(nonnull NSExpression *)inputExpression + (instancetype)mgl_expressionForInterpolatingExpression:(nonnull NSExpression *)inputExpression
@@ -185,10 +185,10 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode
NS_SWIFT_NAME(init(forMLNMatchingKey:in:default:)); NS_SWIFT_NAME(init(forMLNMatchingKey:in:default:));
/** /**
Returns an attributed function expression specifying an `MLNAttributedExpression` constant Returns an attributed function expression specifying an ``MLNAttributedExpression`` constant
expression array. expression array.
@param attributedExpressions The `MLNAttributedExpression` constant expression array. @param attributedExpressions The ``MLNAttributedExpression`` constant expression array.
*/ */
+ (instancetype)mgl_expressionForAttributedExpressions: + (instancetype)mgl_expressionForAttributedExpressions:
(nonnull NSArray<NSExpression *> *)attributedExpressions (nonnull NSArray<NSExpression *> *)attributedExpressions
@@ -199,7 +199,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNExpressionInterpolationMode
/** /**
Returns a constant expression appending the passed expression. Returns a constant expression appending the passed expression.
@note Both the receiver and the given expression must be an `NSString` constant > Note: Both the receiver and the given expression must be an `NSString` constant
expression type; otherwise, an exception is rised. expression type; otherwise, an exception is rised.
@param expression The expression to append to the receiver. @param expression The expression to append to the receiver.

View File

@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
@param object A Foundation object deserialized from JSON data, for example @param object A Foundation object deserialized from JSON data, for example
using `NSJSONSerialization`. using `NSJSONSerialization`.
@return An initialized predicate equivalent to `object`, suitable for use @return An initialized predicate equivalent to `object`, suitable for use
with the `MLNVectorStyleLayer.predicate` property. with the ``MLNVectorStyleLayer/predicate`` property.
*/ */
+ (instancetype)predicateWithMLNJSONObject:(id)object NS_SWIFT_NAME(init(mglJSONObject:)); + (instancetype)predicateWithMLNJSONObject:(id)object NS_SWIFT_NAME(init(mglJSONObject:));

View File

@@ -86,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN
// MARK: Working with Offline Map Values // MARK: Working with Offline Map Values
/** /**
Creates a new value object containing the given `MLNOfflinePackProgress` Creates a new value object containing the given ``MLNOfflinePackProgress``
structure. structure.
@param progress The value for the new object. @param progress The value for the new object.
@@ -95,14 +95,14 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSValue *)valueWithMLNOfflinePackProgress:(MLNOfflinePackProgress)progress; + (NSValue *)valueWithMLNOfflinePackProgress:(MLNOfflinePackProgress)progress;
/** /**
The `MLNOfflinePackProgress` structure representation of the value. The ``MLNOfflinePackProgress`` structure representation of the value.
*/ */
@property (readonly) MLNOfflinePackProgress MLNOfflinePackProgressValue; @property (readonly) MLNOfflinePackProgress MLNOfflinePackProgressValue;
// MARK: Working with Transition Values // MARK: Working with Transition Values
/** /**
Creates a new value object containing the given `MLNTransition` Creates a new value object containing the given ``MLNTransition``
structure. structure.
@param transition The value for the new object. @param transition The value for the new object.
@@ -111,12 +111,12 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSValue *)valueWithMLNTransition:(MLNTransition)transition; + (NSValue *)valueWithMLNTransition:(MLNTransition)transition;
/** /**
The `MLNTransition` structure representation of the value. The ``MLNTransition`` structure representation of the value.
*/ */
@property (readonly) MLNTransition MLNTransitionValue; @property (readonly) MLNTransition MLNTransitionValue;
/** /**
Creates a new value object containing the given `MLNSphericalPosition` Creates a new value object containing the given ``MLNSphericalPosition``
structure. structure.
@param lightPosition The value for the new object. @param lightPosition The value for the new object.
@@ -125,12 +125,12 @@ NS_ASSUME_NONNULL_BEGIN
+ (instancetype)valueWithMLNSphericalPosition:(MLNSphericalPosition)lightPosition; + (instancetype)valueWithMLNSphericalPosition:(MLNSphericalPosition)lightPosition;
/** /**
The `MLNSphericalPosition` structure representation of the value. The ``MLNSphericalPosition`` structure representation of the value.
*/ */
@property (readonly) MLNSphericalPosition MLNSphericalPositionValue; @property (readonly) MLNSphericalPosition MLNSphericalPositionValue;
/** /**
Creates a new value object containing the given `MLNLightAnchor` Creates a new value object containing the given ``MLNLightAnchor``
enum. enum.
@param lightAnchor The value for the new object. @param lightAnchor The value for the new object.
@@ -139,7 +139,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSValue *)valueWithMLNLightAnchor:(MLNLightAnchor)lightAnchor; + (NSValue *)valueWithMLNLightAnchor:(MLNLightAnchor)lightAnchor;
/** /**
The `MLNLightAnchor` enum representation of the value. The ``MLNLightAnchor`` enum representation of the value.
*/ */
@property (readonly) MLNLightAnchor MLNLightAnchorValue; @property (readonly) MLNLightAnchor MLNLightAnchorValue;

View File

@@ -33,7 +33,7 @@ static MLNNativeNetworkManager *instance = nil;
// For testing. Since we get a `nil` return when SDK is modular, we use // For testing. Since we get a `nil` return when SDK is modular, we use
// this for testing requests. // this for testing requests.
// Same as `[MLNNetworkConfiguration defaultSessionConfiguration]` in // Same as `[MLNNetworkConfiguration defaultSessionConfiguration]` in
// `MLNNetworkConfiguration.mm`. // ``MLNNetworkConfiguration/mm``.
configuration = [MLNNativeNetworkManager testSessionConfiguration]; configuration = [MLNNativeNetworkManager testSessionConfiguration];
} }

View File

@@ -541,8 +541,8 @@ class MLNDocumentationExampleTests: XCTestCase, MLNMapViewDelegate {
throw ExampleError.featureIsNotACluster throw ExampleError.featureIsNotACluster
} }
// Currently the only supported class that conforms to `MLNCluster` is // Currently the only supported class that conforms to ``MLNCluster`` is
// `MLNPointFeatureCluster` // ``MLNPointFeatureCluster``
guard cluster is MLNPointFeatureCluster else { guard cluster is MLNPointFeatureCluster else {
throw ExampleError.unexpectedFeatureType throw ExampleError.unexpectedFeatureType
} }

View File

@@ -88,7 +88,7 @@ static NSString * const MLNRendererConfigurationTests_collisionBehaviorKey = @"M
MLNRendererConfiguration *config = [[MLNRendererConfiguration alloc] init]; MLNRendererConfiguration *config = [[MLNRendererConfiguration alloc] init];
// `MLNIdeographicFontFamilyName` set to bool value `YES` // ``MLNIdeographicFontFamilyName`` set to bool value `YES`
{ {
NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@(YES)]; NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@(YES)];
@@ -101,19 +101,19 @@ static NSString * const MLNRendererConfigurationTests_collisionBehaviorKey = @"M
XCTAssertEqualObjects(localFontFamilyName, systemFontFamilyName, @"Local font family name should match default system font name when setting `YES`"); XCTAssertEqualObjects(localFontFamilyName, systemFontFamilyName, @"Local font family name should match default system font name when setting `YES`");
} }
// `MLNIdeographicFontFamilyName` set to bool value `NO` // ``MLNIdeographicFontFamilyName`` set to bool value `NO`
{ {
NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@(NO)]; NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@(NO)];
XCTAssertNil(localFontFamilyName, @"Client rendering font should use remote font when setting `NO`"); XCTAssertNil(localFontFamilyName, @"Client rendering font should use remote font when setting `NO`");
} }
// `MLNIdeographicFontFamilyName` set to a valid font string value // ``MLNIdeographicFontFamilyName`` set to a valid font string value
{ {
NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@"PingFang TC"]; NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@"PingFang TC"];
XCTAssertEqualObjects(localFontFamilyName, @"PingFang TC", @"Local font family name should match a custom valid font name"); XCTAssertEqualObjects(localFontFamilyName, @"PingFang TC", @"Local font family name should match a custom valid font name");
} }
// `MLNIdeographicFontFamilyName` set to an invalid font string value // ``MLNIdeographicFontFamilyName`` set to an invalid font string value
{ {
NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@"test font"]; NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@"test font"];
@@ -126,20 +126,20 @@ static NSString * const MLNRendererConfigurationTests_collisionBehaviorKey = @"M
XCTAssertNotEqualObjects(localFontFamilyName, systemFontFamilyName, @"Local font family name should not be validated by MLNRenderConfiguration"); XCTAssertNotEqualObjects(localFontFamilyName, systemFontFamilyName, @"Local font family name should not be validated by MLNRenderConfiguration");
} }
// `MLNIdeographicFontFamilyName` set to a valid font family names array value // ``MLNIdeographicFontFamilyName`` set to a valid font family names array value
{ {
NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@[@"test font 1", @"PingFang TC", @"test font 2"]]; NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@[@"test font 1", @"PingFang TC", @"test font 2"]];
XCTAssertEqualObjects(localFontFamilyName, @"test font 1\nPingFang TC\ntest font 2"); XCTAssertEqualObjects(localFontFamilyName, @"test font 1\nPingFang TC\ntest font 2");
} }
// `MLNIdeographicFontFamilyName` set to an invalid font family names array value // ``MLNIdeographicFontFamilyName`` set to an invalid font family names array value
{ {
NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@[@"test font 1", @"test font 2", @"test font 3"]]; NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:@[@"test font 1", @"test font 2", @"test font 3"]];
XCTAssertEqualObjects(localFontFamilyName, @"test font 1\ntest font 2\ntest font 3", @"Local font family name should not be validated by MLNRendererConfiguration"); XCTAssertEqualObjects(localFontFamilyName, @"test font 1\ntest font 2\ntest font 3", @"Local font family name should not be validated by MLNRendererConfiguration");
} }
// `MLNIdeographicFontFamilyName` set to an invalid value type: NSDictionary, NSNumber, NSData, etc. // ``MLNIdeographicFontFamilyName`` set to an invalid value type: NSDictionary, NSNumber, NSData, etc.
{ {
NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:[@"test font 1" dataUsingEncoding:NSUTF8StringEncoding]]; NSString *localFontFamilyName = [config localFontFamilyNameWithInfoDictionaryObject:[@"test font 1" dataUsingEncoding:NSUTF8StringEncoding]];

View File

@@ -298,7 +298,7 @@
} }
- (void)testNetworkConfigurationWithSessionConfigurationWithCustomHeadersLOCKED { - (void)testNetworkConfigurationWithSessionConfigurationWithCustomHeadersLOCKED {
// Custom session configuration, based on `MLNNetworkConfiguration.defaultSessionConfiguration` // Custom session configuration, based on ``MLNNetworkConfiguration/defaultSessionConfiguration``
NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration];
sessionConfig.HTTPAdditionalHeaders = @{ @"testing" : @YES }; sessionConfig.HTTPAdditionalHeaders = @{ @"testing" : @YES };
sessionConfig.HTTPMaximumConnectionsPerHost = 1; sessionConfig.HTTPMaximumConnectionsPerHost = 1;

View File

@@ -68,7 +68,7 @@ class BuildingLightExample: UIViewController, MLNMapViewDelegate {
} }
func addFillExtrusionLayer(style: MLNStyle) { func addFillExtrusionLayer(style: MLNStyle) {
// Access the OpenMapTiles source and use it to create a `MLNFillExtrusionStyleLayer`. The source identifier is `openmaptiles`. Use the `sources` property on a style to verify source identifiers. // Access the OpenMapTiles source and use it to create a ``MLNFillExtrusionStyleLayer``. The source identifier is `openmaptiles`. Use the `sources` property on a style to verify source identifiers.
guard let source = style.source(withIdentifier: "openmaptiles") else { guard let source = style.source(withIdentifier: "openmaptiles") else {
print("Could not find source openmaptiles") print("Could not find source openmaptiles")
return return

View File

@@ -5,14 +5,14 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNAnnotationImage` class is responsible for presenting point-based The ``MLNAnnotationImage`` class is responsible for presenting point-based
annotations visually on a map view. Annotation image objects wrap `UIImage` 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 objects and may be recycled later and put into a reuse queue that is maintained
by the map view. by the map view.
#### Related examples #### Related examples
TODO: Mark a place on the map with an image, learn how use an image TODO: Mark a place on the map with an image, learn how use an image
as a marker using `MLNAnnotationImage`. as a marker using ``MLNAnnotationImage``.
*/ */
MLN_EXPORT MLN_EXPORT
@interface MLNAnnotationImage : NSObject <NSSecureCoding> @interface MLNAnnotationImage : NSObject <NSSecureCoding>

View File

@@ -39,7 +39,7 @@ typedef NS_ENUM(NSUInteger, MLNAnnotationViewDragState) {
}; };
/** /**
The `MLNAnnotationView` class is responsible for marking a point annotation The ``MLNAnnotationView`` class is responsible for marking a point annotation
with a view. Annotation views represent an annotation object, which is an with a view. Annotation views represent an annotation object, which is an
object that corresponds to the ``MLNAnnotation`` protocol. When an annotation’s object that corresponds to the ``MLNAnnotation`` protocol. When an annotation’s
geographic coordinate is visible in the map view, the map view asks its geographic coordinate is visible in the map view, the map view asks its
@@ -65,7 +65,7 @@ MLN_EXPORT
leaves the viewport, the map view moves its associated view to a reuse queue. leaves the viewport, the map view moves its associated view to a reuse queue.
When a new annotation becomes visible, you can request a view for that When a new annotation becomes visible, you can request a view for that
annotation by passing the appropriate reuse identifier string to the annotation by passing the appropriate reuse identifier string to the
`-[MLNMapView dequeueReusableAnnotationViewWithIdentifier:]` method. ``MLNMapView/dequeueReusableAnnotationViewWithIdentifier:`` method.
@param reuseIdentifier A unique string identifier for this view that allows you @param reuseIdentifier A unique string identifier for this view that allows you
to reuse this view with multiple similar annotations. You can set this to reuse this view with multiple similar annotations. You can set this
@@ -173,7 +173,7 @@ MLN_EXPORT
The default value of this property is `NO`. Keep this property set to `NO` if The default value of this property is `NO`. Keep this property set to `NO` if
the view’s legibility is important. the view’s legibility is important.
@note Scaling many on-screen annotation views can contribute to poor map > Note: Scaling many on-screen annotation views can contribute to poor map
performance. Consider keeping this property disabled if your use case performance. Consider keeping this property disabled if your use case
involves hundreds or thousands of annotation views. involves hundreds or thousands of annotation views.
*/ */
@@ -256,7 +256,7 @@ MLN_EXPORT
continue to completion. continue to completion.
#### Related examples #### Related examples
TODO: Enable users to drag `MLNAnnotationView` objects on your map. TODO: Enable users to drag ``MLNAnnotationView`` objects on your map.
*/ */
@property (nonatomic, assign, getter=isDraggable) BOOL draggable; @property (nonatomic, assign, getter=isDraggable) BOOL draggable;

View File

@@ -10,17 +10,17 @@ NS_ASSUME_NONNULL_BEGIN
A protocol for a `UIView` subclass that displays information about a selected A protocol for a `UIView` subclass that displays information about a selected
annotation near that annotation. annotation near that annotation.
To receive updates from an object that conforms to the `MLNCalloutView` protocol, To receive updates from an object that conforms to the ``MLNCalloutView`` protocol,
use the optional methods available in the `MLNCalloutViewDelegate` protocol. use the optional methods available in the ``MLNCalloutViewDelegate`` protocol.
#### Related examples #### Related examples
TODO: Display custom views as callouts by customizing an TODO: Display custom views as callouts by customizing an
`MLNCalloutView`. ``MLNCalloutView``.
*/ */
@protocol MLNCalloutView <NSObject> @protocol MLNCalloutView <NSObject>
/** /**
An object conforming to the `MLNAnnotation` protocol whose details this callout An object conforming to the ``MLNAnnotation`` protocol whose details this callout
view displays. view displays.
*/ */
@property (nonatomic, strong) id<MLNAnnotation> representedObject; @property (nonatomic, strong) id<MLNAnnotation> representedObject;
@@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) UIView *rightAccessoryView; @property (nonatomic, strong) UIView *rightAccessoryView;
/** /**
An object conforming to the `MLNCalloutViewDelegate` method that receives An object conforming to the ``MLNCalloutViewDelegate`` method that receives
messages related to the callout view’s interactive subviews. messages related to the callout view’s interactive subviews.
*/ */
@property (nonatomic, weak) id<MLNCalloutViewDelegate> delegate; @property (nonatomic, weak) id<MLNCalloutViewDelegate> delegate;
@@ -83,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN
but the left and right margins from a minimum width that the callout should have. but the left and right margins from a minimum width that the callout should have.
@param rect Rect that the callout is presented from. This should be the same as the one passed in @param rect Rect that the callout is presented from. This should be the same as the one passed in
`-[MLNCalloutView presentCalloutFromRect:inView:constrainedToRect:animated:]` ``MLNCalloutView/presentCalloutFromRect:inView:constrainedToRect:animated:``
@return `UIEdgeInsets` representing the margins. Values should be negative. @return `UIEdgeInsets` representing the margins. Values should be negative.
*/ */
- (UIEdgeInsets)marginInsetsHintForPresentationFromRect:(CGRect)rect - (UIEdgeInsets)marginInsetsHintForPresentationFromRect:(CGRect)rect
@@ -108,9 +108,9 @@ NS_ASSUME_NONNULL_BEGIN
@end @end
/** /**
The `MLNCalloutViewDelegate` protocol defines a set of optional methods that The ``MLNCalloutViewDelegate`` protocol defines a set of optional methods that
you can use to receive messages from an object that conforms to the you can use to receive messages from an object that conforms to the
`MLNCalloutView` protocol. The callout view uses these methods to inform the ``MLNCalloutView`` protocol. The callout view uses these methods to inform the
delegate that the user has interacted with the the callout view. delegate that the user has interacted with the the callout view.
*/ */
@protocol MLNCalloutViewDelegate <NSObject> @protocol MLNCalloutViewDelegate <NSObject>

View File

@@ -1,24 +1,23 @@
#import "MLNFoundation.h" #import "MLNFoundation.h"
/** /**
:nodoc:
Bitmask values that describe why a camera move occurred. Bitmask values that describe why a camera move occurred.
Values of this type are passed to the `MLNMapView`'s delegate in the following methods: Values of this type are passed to the ``MLNMapView``'s delegate in the following methods:
- `-mapView:shouldChangeFromCamera:toCamera:reason:` - ``MLNMapViewDelegate/mapView:shouldChangeFromCamera:toCamera:reason:``
- `-mapView:regionWillChangeWithReason:animated:` - ``MLNMapViewDelegate/mapView:regionWillChangeWithReason:animated:``
- `-mapView:regionIsChangingWithReason:` - ``MLNMapViewDelegate/mapView:regionIsChangingWithReason:``
- `-mapView:regionDidChangeWithReason:animated:` - ``MLNMapViewDelegate/mapView:regionDidChangeWithReason:animated:``
It's important to note that it's almost impossible to perform a rotate without zooming (in or out), It's important to note that it's almost impossible to perform a rotate without zooming (in or out),
so if you'll often find `MLNCameraChangeReasonGesturePinch` set alongside so if you'll often find ``MLNCameraChangeReasonGesturePinch`` set alongside
`MLNCameraChangeReasonGestureRotate`. ``MLNCameraChangeReasonGestureRotate``.
Since there are several reasons why a zoom or rotation has occurred, it is worth considering Since there are several reasons why a zoom or rotation has occurred, it is worth considering
creating a combined constant, for example: creating a combined constant, for example:
``` ```objc
static const MLNCameraChangeReason anyZoom = MLNCameraChangeReasonGesturePinch | static const MLNCameraChangeReason anyZoom = MLNCameraChangeReasonGesturePinch |
MLNCameraChangeReasonGestureZoomIn | MLNCameraChangeReasonGestureZoomIn |
MLNCameraChangeReasonGestureZoomOut | MLNCameraChangeReasonGestureZoomOut |
@@ -29,39 +28,39 @@
``` ```
*/ */
typedef NS_OPTIONS(NSUInteger, MLNCameraChangeReason) { typedef NS_OPTIONS(NSUInteger, MLNCameraChangeReason) {
/// :nodoc: The reason for the camera change has not be specified. /// The reason for the camera change has not be specified.
MLNCameraChangeReasonNone = 0, MLNCameraChangeReasonNone = 0,
/// :nodoc: Set when a public API that moves the camera is called. This may be set for some /// Set when a public API that moves the camera is called. This may be set for some
/// gestures, for example MLNCameraChangeReasonResetNorth. /// gestures, for example MLNCameraChangeReasonResetNorth.
MLNCameraChangeReasonProgrammatic = 1 << 0, MLNCameraChangeReasonProgrammatic = 1 << 0,
/// :nodoc: The user tapped the compass to reset the map orientation so North is up. /// The user tapped the compass to reset the map orientation so North is up.
MLNCameraChangeReasonResetNorth = 1 << 1, MLNCameraChangeReasonResetNorth = 1 << 1,
/// :nodoc: The user panned the map. /// The user panned the map.
MLNCameraChangeReasonGesturePan = 1 << 2, MLNCameraChangeReasonGesturePan = 1 << 2,
/// :nodoc: The user pinched to zoom in/out. /// The user pinched to zoom in/out.
MLNCameraChangeReasonGesturePinch = 1 << 3, MLNCameraChangeReasonGesturePinch = 1 << 3,
// :nodoc: The user rotated the map. // :nodoc: The user rotated the map.
MLNCameraChangeReasonGestureRotate = 1 << 4, MLNCameraChangeReasonGestureRotate = 1 << 4,
/// :nodoc: The user zoomed the map in (one finger double tap). /// The user zoomed the map in (one finger double tap).
MLNCameraChangeReasonGestureZoomIn = 1 << 5, MLNCameraChangeReasonGestureZoomIn = 1 << 5,
/// :nodoc: The user zoomed the map out (two finger single tap). /// The user zoomed the map out (two finger single tap).
MLNCameraChangeReasonGestureZoomOut = 1 << 6, MLNCameraChangeReasonGestureZoomOut = 1 << 6,
/// :nodoc: The user long pressed on the map for a quick zoom (single tap, then long press and /// The user long pressed on the map for a quick zoom (single tap, then long press and
/// drag up/down). /// drag up/down).
MLNCameraChangeReasonGestureOneFingerZoom = 1 << 7, MLNCameraChangeReasonGestureOneFingerZoom = 1 << 7,
// :nodoc: The user panned with two fingers to tilt the map (two finger drag). // The user panned with two fingers to tilt the map (two finger drag).
MLNCameraChangeReasonGestureTilt = 1 << 8, MLNCameraChangeReasonGestureTilt = 1 << 8,
// :nodoc: Cancelled // Cancelled
MLNCameraChangeReasonTransitionCancelled = 1 << 16 MLNCameraChangeReasonTransitionCancelled = 1 << 16
}; };

View File

@@ -2,7 +2,7 @@
#import "SMCalloutView.h" #import "SMCalloutView.h"
/** /**
A concrete implementation of `MLNCalloutView` based on A concrete implementation of ``MLNCalloutView`` based on
<a href="https://github.com/nfarina/calloutview">SMCalloutView</a>. This <a href="https://github.com/nfarina/calloutview">SMCalloutView</a>. This
callout view displays the represented annotation’s title, subtitle, and callout view displays the represented annotation’s title, subtitle, and
accessory views in a compact, two-line layout. accessory views in a compact, two-line layout.

View File

@@ -31,7 +31,7 @@ MLN_EXPORT
@param camera The new camera to be used in the projection calculation. @param camera The new camera to be used in the projection calculation.
@param insets The insets applied on top of the camera be used in the projection calculation. @param insets The insets applied on top of the camera be used in the projection calculation.
@note `MLNMapView` instance frame must not be changed since this projection is initialized, > Note: ``MLNMapView`` instance frame must not be changed since this projection is initialized,
otherwise the calculation may be wrong. otherwise the calculation may be wrong.
*/ */
- (void)setCamera:(MLNMapCamera *_Nonnull)camera withEdgeInsets:(UIEdgeInsets)insets; - (void)setCamera:(MLNMapCamera *_Nonnull)camera withEdgeInsets:(UIEdgeInsets)insets;
@@ -42,7 +42,7 @@ MLN_EXPORT
@param bounds The bounds that the viewport should fit. @param bounds The bounds that the viewport should fit.
@param insets The insets applied on top of the viewport to be used in the projection calculation. @param insets The insets applied on top of the viewport to be used in the projection calculation.
@note `MLNMapView` instance frame must not be changed since this projection is initialized, > Note: ``MLNMapView`` instance frame must not be changed since this projection is initialized,
otherwise the calculation may be wrong. otherwise the calculation may be wrong.
*/ */
- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets; - (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets;

View File

@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol MLNFeature; @protocol MLNFeature;
@protocol MLNLocationManager; @protocol MLNLocationManager;
/** Options for `MLNMapView.decelerationRate`. */ /** Options for ``MLNMapView/decelerationRate``. */
typedef CGFloat MLNMapViewDecelerationRate NS_TYPED_EXTENSIBLE_ENUM; typedef CGFloat MLNMapViewDecelerationRate NS_TYPED_EXTENSIBLE_ENUM;
/** The default deceleration rate for a map view. */ /** The default deceleration rate for a map view. */
@@ -40,7 +40,7 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNMapViewDecelerationRate MLNMapViewDecelera
/** /**
The vertical alignment of an annotation within a map view. Used with The vertical alignment of an annotation within a map view. Used with
`MLNMapView.userLocationVerticalAlignment`. ``MLNMapView/userLocationVerticalAlignment``.
*/ */
typedef NS_ENUM(NSUInteger, MLNAnnotationVerticalAlignment) { typedef NS_ENUM(NSUInteger, MLNAnnotationVerticalAlignment) {
/** Aligns the annotation vertically in the center of the map view. */ /** Aligns the annotation vertically in the center of the map view. */
@@ -53,10 +53,10 @@ typedef NS_ENUM(NSUInteger, MLNAnnotationVerticalAlignment) {
/** /**
The position of scale bar, compass, logo and attribution in a map view. Used with The position of scale bar, compass, logo and attribution in a map view. Used with
`MLNMapView.scaleBarPosition`, ``MLNMapView/scaleBarPosition``,
`MLNMapView.compassViewPosition`, ``MLNMapView/compassViewPosition``,
`MLNMapView.logoViewPosition`, ``MLNMapView/logoViewPosition``,
`MLNMapView.attributionButtonPosition`. ``MLNMapView/attributionButtonPosition``.
*/ */
typedef NS_ENUM(NSUInteger, MLNOrnamentPosition) { typedef NS_ENUM(NSUInteger, MLNOrnamentPosition) {
/** Place the ornament in the top left of the map view. */ /** Place the ornament in the top left of the map view. */
@@ -71,7 +71,7 @@ typedef NS_ENUM(NSUInteger, MLNOrnamentPosition) {
/** /**
The mode used to track the user location on the map. Used with The mode used to track the user location on the map. Used with
`MLNMapView.userTrackingMode`. ``MLNMapView/userTrackingMode``.
#### Related examples #### Related examples
- TODO: Switch between user tracking modes</a> example to learn how to toggle modes and - TODO: Switch between user tracking modes</a> example to learn how to toggle modes and
@@ -81,7 +81,7 @@ typedef NS_ENUM(NSUInteger, MLNUserTrackingMode) {
/** The map does not follow the user location. */ /** The map does not follow the user location. */
MLNUserTrackingModeNone = 0, MLNUserTrackingModeNone = 0,
/** The map follows the user location. This tracking mode falls back /** The map follows the user location. This tracking mode falls back
to `MLNUserTrackingModeNone` if the user pans the map view. */ to ``MLNUserTrackingMode/MLNUserTrackingModeNone`` if the user pans the map view. */
MLNUserTrackingModeFollow, MLNUserTrackingModeFollow,
/** /**
The map follows the user location and rotates when the heading changes. The map follows the user location and rotates when the heading changes.
@@ -91,7 +91,7 @@ typedef NS_ENUM(NSUInteger, MLNUserTrackingMode) {
This tracking mode is disabled if the user pans the map view, but This tracking mode is disabled if the user pans the map view, but
remains enabled if the user zooms in. If the user rotates the map remains enabled if the user zooms in. If the user rotates the map
view, this tracking mode will fall back to `MLNUserTrackingModeFollow`. view, this tracking mode will fall back to ``MLNUserTrackingModeFollow``.
*/ */
MLNUserTrackingModeFollowWithHeading, MLNUserTrackingModeFollowWithHeading,
/** /**
@@ -102,7 +102,7 @@ typedef NS_ENUM(NSUInteger, MLNUserTrackingMode) {
This tracking mode is disabled if the user pans the map view, but This tracking mode is disabled if the user pans the map view, but
remains enabled if the user zooms in. If the user rotates the map view, remains enabled if the user zooms in. If the user rotates the map view,
this tracking mode will fall back to `MLNUserTrackingModeFollow`. this tracking mode will fall back to ``MLNUserTrackingModeFollow``.
*/ */
MLNUserTrackingModeFollowWithCourse, MLNUserTrackingModeFollowWithCourse,
}; };
@@ -116,7 +116,7 @@ typedef NS_ENUM(NSUInteger, MLNPanScrollingMode) {
MLNPanScrollingModeDefault MLNPanScrollingModeDefault
}; };
/** Options for `MLNMapView.preferredFramesPerSecond`. */ /** Options for ``MLNMapView/preferredFramesPerSecond``. */
typedef NSInteger MLNMapViewPreferredFramesPerSecond NS_TYPED_EXTENSIBLE_ENUM; typedef NSInteger MLNMapViewPreferredFramesPerSecond NS_TYPED_EXTENSIBLE_ENUM;
/** /**
@@ -142,7 +142,7 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNUserLocationAnnotationTyp
An interactive, customizable map view with an interface similar to the one An interactive, customizable map view with an interface similar to the one
provided by Apple’s MapKit. 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 manipulate it with standard gestures, animate the map between different
viewpoints, and present information in the form of annotations and overlays. viewpoints, and present information in the form of annotations and overlays.
@@ -154,15 +154,15 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNUserLocationAnnotationTyp
<a href="https://maplibre.org/maputnik/">Maputnik</a>. <a href="https://maplibre.org/maputnik/">Maputnik</a>.
Because `MLNMapView` loads asynchronously, several delegate methods are available Because ``MLNMapView`` loads asynchronously, several delegate methods are available
for receiving map-related updates. These methods can be used to ensure that certain operations for receiving map-related updates. These methods can be used to ensure that certain operations
have completed before taking any additional actions. Information on these methods is located have completed before taking any additional actions. Information on these methods is located
in the `MLNMapViewDelegate` protocol documentation. in the ``MLNMapViewDelegate`` protocol documentation.
Adding your own gesture recognizer to `MLNMapView` will block the corresponding Adding your own gesture recognizer to ``MLNMapView`` will block the corresponding
gesture recognizer built into `MLNMapView`. To avoid conflicts, define which gesture recognizer built into ``MLNMapView``. To avoid conflicts, define which
gesture takes precedence. For example, you can create your own gesture takes precedence. For example, you can create your own
`UITapGestureRecognizer` that will be invoked only if the default `MLNMapView` `UITapGestureRecognizer` that will be invoked only if the default ``MLNMapView``
tap gesture fails: tap gesture fails:
```swift ```swift
@@ -173,7 +173,7 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNUserLocationAnnotationTyp
mapView.addGestureRecognizer(mapTapGestureRecognizer) mapView.addGestureRecognizer(mapTapGestureRecognizer)
``` ```
@note You are responsible for getting permission to use the map data and for > Note: You are responsible for getting permission to use the map data and for
ensuring that your use adheres to the relevant terms of use. ensuring that your use adheres to the relevant terms of use.
*/ */
MLN_EXPORT MLN_EXPORT
@@ -202,8 +202,8 @@ MLN_EXPORT
#### Related examples #### Related examples
- TODO: initialize an `MLNMapView` with a custom style - TODO: initialize an ``MLNMapView`` with a custom style
- TODO: how to initialize an `MLNMapView` with a third-party tile source - TODO: how to initialize an ``MLNMapView`` with a third-party tile source
*/ */
- (instancetype)initWithFrame:(CGRect)frame styleURL:(nullable NSURL *)styleURL; - (instancetype)initWithFrame:(CGRect)frame styleURL:(nullable NSURL *)styleURL;
@@ -230,8 +230,8 @@ MLN_EXPORT
If the style is loading, this property is set to `nil` until the style finishes 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`. 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 Because the style loads asynchronously, you should manipulate it in the
`-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or ``MLNMapViewDelegate/mapView:didFinishLoadingStyle:`` or
`-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` method. It is not possible ``MLNMapViewDelegate/mapViewDidFinishLoadingMap:`` method. It is not possible
to manipulate the style before it has finished loading. to manipulate the style before it has finished loading.
*/ */
@property (nonatomic, readonly, nullable) MLNStyle *style; @property (nonatomic, readonly, nullable) MLNStyle *style;
@@ -309,7 +309,8 @@ MLN_EXPORT
@property (nonatomic, assign) BOOL scaleBarUsesMetricSystem; @property (nonatomic, assign) BOOL scaleBarUsesMetricSystem;
/** /**
The position of the scale bar. The default value is `MLNOrnamentPositionTopLeft`. The position of the scale bar. The default value is
``MLNOrnamentPosition/MLNOrnamentPositionTopLeft``.
*/ */
@property (nonatomic, assign) MLNOrnamentPosition scaleBarPosition; @property (nonatomic, assign) MLNOrnamentPosition scaleBarPosition;
@@ -325,7 +326,8 @@ MLN_EXPORT
@property (nonatomic, readonly) MLNCompassButton *compassView; @property (nonatomic, readonly) MLNCompassButton *compassView;
/** /**
The position of the compass view. The default value is `MLNOrnamentPositionTopRight`. The position of the compass view. The default value is
``MLNOrnamentPosition/MLNOrnamentPositionTopRight``.
*/ */
@property (nonatomic, assign) MLNOrnamentPosition compassViewPosition; @property (nonatomic, assign) MLNOrnamentPosition compassViewPosition;
@@ -341,7 +343,8 @@ MLN_EXPORT
@property (nonatomic, readonly) UIImageView *logoView; @property (nonatomic, readonly) UIImageView *logoView;
/** /**
The position of the logo view. The default value is `MLNOrnamentPositionBottomLeft`. The position of the logo view. The default value is
``MLNOrnamentPosition/MLNOrnamentPositionBottomLeft``.
*/ */
@property (nonatomic, assign) MLNOrnamentPosition logoViewPosition; @property (nonatomic, assign) MLNOrnamentPosition logoViewPosition;
@@ -357,7 +360,7 @@ MLN_EXPORT
If you choose to reimplement this view, assign the `-showAttribution:` method If you choose to reimplement this view, assign the `-showAttribution:` method
as the action for your view to present the default notices and settings. as the action for your view to present the default notices and settings.
@note Attribution is often required for many vector sources, > Note: Attribution is often required for many vector sources,
OpenStreetMap data, or other data such as satellite or terrain OpenStreetMap data, or other data such as satellite or terrain
data. If that applies to this map view, do not hide this view or remove data. If that applies to this map view, do not hide this view or remove
any notices from it. any notices from it.
@@ -366,7 +369,8 @@ MLN_EXPORT
@property (nonatomic, readonly) UIButton *attributionButton; @property (nonatomic, readonly) UIButton *attributionButton;
/** /**
The position of the attribution button. The default value is `MLNOrnamentPositionBottomRight`. The position of the attribution button. The default value is
``MLNOrnamentPosition/MLNOrnamentPositionBottomRight``.
*/ */
@property (nonatomic, assign) MLNOrnamentPosition attributionButtonPosition; @property (nonatomic, assign) MLNOrnamentPosition attributionButtonPosition;
@@ -388,11 +392,11 @@ MLN_EXPORT
The preferred frame rate at which the map view is rendered. The preferred frame rate at which the map view is rendered.
The default value for this property is The default value for this property is
`MLNMapViewPreferredFramesPerSecondDefault`, which will adaptively set the ``MLNMapViewPreferredFramesPerSecondDefault``, which will adaptively set the
preferred frame rate based on the capability of the user’s device to maintain preferred frame rate based on the capability of the user’s device to maintain
a smooth experience. a smooth experience.
In addition to the provided `MLNMapViewPreferredFramesPerSecond` options, this In addition to the provided ``MLNMapViewPreferredFramesPerSecond`` options, this
property can be set to arbitrary integer values. property can be set to arbitrary integer values.
@see `CADisplayLink.preferredFramesPerSecond` @see `CADisplayLink.preferredFramesPerSecond`
@@ -418,13 +422,13 @@ MLN_EXPORT
location-related updates. location-related updates.
To receive the current user location, implement the To receive the current user location, implement the
`-[MLNMapViewDelegate mapView:didUpdateUserLocation:]` and ``MLNMapViewDelegate/mapView:didUpdateUserLocation:`` and
`-[MLNMapViewDelegate mapView:didFailToLocateUserWithError:]` methods. ``MLNMapViewDelegate/mapView:didFailToLocateUserWithError:`` methods.
If setting this property to `nil` or if no custom manager is provided this If setting this property to `nil` or if no custom manager is provided this
property is set to the default location manager. property is set to the default location manager.
`MLNMapView` uses a default location manager. If you want to substitute your ``MLNMapView`` uses a default location manager. If you want to substitute your
own location manager, you should do so by setting this property before setting own location manager, you should do so by setting this property before setting
`showsUserLocation` to `YES`. To restore the default location manager, `showsUserLocation` to `YES`. To restore the default location manager,
set this property to `nil`. set this property to `nil`.
@@ -479,7 +483,7 @@ MLN_EXPORT
/** /**
The mode used to track the user location. The default value is The mode used to track the user location. The default value is
`MLNUserTrackingModeNone`. ``MLNUserTrackingMode/MLNUserTrackingModeNone``.
Changing the value of this property updates the map view with an animated Changing the value of this property updates the map view with an animated
transition. If you don’t want to animate the change, use the transition. If you don’t want to animate the change, use the
@@ -487,7 +491,7 @@ MLN_EXPORT
#### Related examples #### Related examples
- TODO: Customize the user location annotation and learn how to customize the - TODO: Customize the user location annotation and learn how to customize the
default user location annotation shown by `MLNUserTrackingMode`. default user location annotation shown by ``MLNUserTrackingMode``.
*/ */
@property (nonatomic, assign) MLNUserTrackingMode userTrackingMode; @property (nonatomic, assign) MLNUserTrackingMode userTrackingMode;
@@ -526,15 +530,15 @@ MLN_EXPORT
/** /**
The vertical alignment of the user location annotation within the receiver. The The vertical alignment of the user location annotation within the receiver. The
default value is `MLNAnnotationVerticalAlignmentCenter`. default value is ``MLNAnnotationVerticalAlignment/MLNAnnotationVerticalAlignmentCenter``.
Changing the value of this property updates the map view with an animated Changing the value of this property updates the map view with an animated
transition. If you don’t want to animate the change, use the transition. If you don’t want to animate the change, use the
`-setUserLocationVerticalAlignment:animated:` method instead. `-setUserLocationVerticalAlignment:animated:` method instead.
*/ */
@property (nonatomic, assign) MLNAnnotationVerticalAlignment userLocationVerticalAlignment @property (nonatomic, assign) MLNAnnotationVerticalAlignment userLocationVerticalAlignment
__attribute__(( __attribute__((deprecated("Use ``MLNMapViewDelegate/mapViewUserLocationAnchorPoint:`` instead.")
deprecated("Use `-[MLNMapViewDelegate mapViewUserLocationAnchorPoint:]` instead."))); ));
/** /**
Sets the vertical alignment of the user location annotation within the Sets the vertical alignment of the user location annotation within the
@@ -548,7 +552,7 @@ MLN_EXPORT
- (void)setUserLocationVerticalAlignment:(MLNAnnotationVerticalAlignment)alignment - (void)setUserLocationVerticalAlignment:(MLNAnnotationVerticalAlignment)alignment
animated:(BOOL)animated animated:(BOOL)animated
__attribute__(( __attribute__((
deprecated("Use `-[MLNMapViewDelegate mapViewUserLocationAnchorPoint:]` instead."))); deprecated("Use ``MLNMapViewDelegate/mapViewUserLocationAnchorPoint:`` instead.")));
/** /**
Updates the position of the user location annotation view by retreiving the user's last Updates the position of the user location annotation view by retreiving the user's last
@@ -570,11 +574,11 @@ MLN_EXPORT
Setting this property to `YES` causes the default user location annotation to Setting this property to `YES` causes the default user location annotation to
appear and always show an arrow-shaped heading indicator, if heading is appear and always show an arrow-shaped heading indicator, if heading is
available. This property does not rotate the map; for that, see available. This property does not rotate the map; for that, see
`MLNUserTrackingModeFollowWithHeading`. ``MLNUserTrackingMode/MLNUserTrackingModeFollowWithHeading``.
This property has no effect when `userTrackingMode` is This property has no effect when ``userTrackingMode`` is
`MLNUserTrackingModeFollowWithHeading` or ``MLNUserTrackingMode/MLNUserTrackingModeFollowWithHeading`` or
`MLNUserTrackingModeFollowWithCourse`. ``MLNUserTrackingMode/MLNUserTrackingModeFollowWithCourse``.
The default value of this property is `NO`. The default value of this property is `NO`.
*/ */
@@ -598,7 +602,7 @@ MLN_EXPORT
to fit both foci optimally within the viewport. to fit both foci optimally within the viewport.
This property has no effect if the `userTrackingMode` property is set to a This property has no effect if the `userTrackingMode` property is set to a
value other than `MLNUserTrackingModeFollowWithCourse`. value other than ``MLNUserTrackingMode/MLNUserTrackingModeFollowWithCourse``.
Changing the value of this property updates the map view with an animated Changing the value of this property updates the map view with an animated
transition. If you don’t want to animate the change, use the transition. If you don’t want to animate the change, use the
@@ -618,7 +622,7 @@ MLN_EXPORT
to fit both foci optimally within the viewport. to fit both foci optimally within the viewport.
This method has no effect if the `userTrackingMode` property is set to a value This method has no effect if the `userTrackingMode` property is set to a value
other than `MLNUserTrackingModeFollowWithCourse`. other than ``MLNUserTrackingMode/MLNUserTrackingModeFollowWithCourse``.
To specify a completion handler to execute after the animation finishes, use To specify a completion handler to execute after the animation finishes, use
the `-setTargetCoordinate:animated:completionHandler:` method. the `-setTargetCoordinate:animated:completionHandler:` method.
@@ -644,7 +648,7 @@ MLN_EXPORT
to fit both foci optimally within the viewport. to fit both foci optimally within the viewport.
This method has no effect if the `userTrackingMode` property is set to a value This method has no effect if the `userTrackingMode` property is set to a value
other than `MLNUserTrackingModeFollowWithCourse`. other than ``MLNUserTrackingMode/MLNUserTrackingModeFollowWithCourse``.
@param targetCoordinate The target coordinate to fit within the viewport. @param targetCoordinate The target coordinate to fit within the viewport.
@param animated If `YES`, the map animates to fit the target within the map @param animated If `YES`, the map animates to fit the target within the map
@@ -691,10 +695,10 @@ MLN_EXPORT
restricting a user's ability to scroll vertically. restricting a user's ability to scroll vertically.
`MLNPanScrollingModeVertical` only allows the user to scroll vertically on the map, `MLNPanScrollingModeVertical` only allows the user to scroll vertically on the map,
restricting a user's ability to scroll horizontally. restricting a user's ability to scroll horizontally.
`MLNPanScrollingModeDefault` allows the user to scroll both horizontally and vertically ``MLNPanScrollingMode/MLNPanScrollingModeDefault`` allows the user to scroll both horizontally and
on the map. vertically on the map.
By default, this property is set to `MLNPanScrollingModeDefault`. By default, this property is set to ``MLNPanScrollingMode/MLNPanScrollingModeDefault``.
*/ */
@property (nonatomic, assign) MLNPanScrollingMode panScrollingMode; @property (nonatomic, assign) MLNPanScrollingMode panScrollingMode;
@@ -749,9 +753,9 @@ MLN_EXPORT
A floating-point value that determines the rate of deceleration after the user A floating-point value that determines the rate of deceleration after the user
lifts their finger. lifts their finger.
Your application can use the `MLNMapViewDecelerationRateNormal` and Your application can use the ``MLNMapViewDecelerationRateNormal`` and
`MLNMapViewDecelerationRateFast` constants as reference points for reasonable ``MLNMapViewDecelerationRateFast`` constants as reference points for reasonable
deceleration rates. `MLNMapViewDecelerationRateImmediate` can be used to deceleration rates. ``MLNMapViewDecelerationRateImmediate`` can be used to
disable deceleration entirely. disable deceleration entirely.
*/ */
@property (nonatomic) CGFloat decelerationRate; @property (nonatomic) CGFloat decelerationRate;
@@ -782,7 +786,7 @@ MLN_EXPORT
location or `NO` if you want the map to display the new location location or `NO` if you want the map to display the new location
immediately. immediately.
@note The behavior of this method is undefined if called in response to > Note: The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`. `UIApplicationWillTerminateNotification`.
*/ */
- (void)setCenterCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated; - (void)setCenterCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated;
@@ -798,7 +802,7 @@ MLN_EXPORT
zooming to the new location or `NO` if you want the map to display the new zooming to the new location or `NO` if you want the map to display the new
location immediately. location immediately.
@note The behavior of this method is undefined if called in response to > Note: The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`. `UIApplicationWillTerminateNotification`.
*/ */
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
@@ -818,7 +822,7 @@ MLN_EXPORT
zooming, and rotating to the new location or `NO` if you want the map to zooming, and rotating to the new location or `NO` if you want the map to
display the new location immediately. display the new location immediately.
@note The behavior of this method is undefined if called in response to > Note: The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`. `UIApplicationWillTerminateNotification`.
*/ */
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
@@ -840,7 +844,7 @@ MLN_EXPORT
display the new location immediately. display the new location immediately.
@param completion The block executed after the animation finishes. @param completion The block executed after the animation finishes.
@note The behavior of this method is undefined if called in response to > Note: The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`. `UIApplicationWillTerminateNotification`.
*/ */
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
@@ -1310,7 +1314,7 @@ MLN_EXPORT
including the entire coordinate bounds. The camera object uses the current including the entire coordinate bounds. The camera object uses the current
direction and pitch. direction and pitch.
@note The behavior of this method is undefined if called in response to > Note: The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value `UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery. depending on the order of notification delivery.
*/ */
@@ -1328,7 +1332,7 @@ MLN_EXPORT
including the entire coordinate bounds. The camera object uses the current including the entire coordinate bounds. The camera object uses the current
direction and pitch. direction and pitch.
@note The behavior of this method is undefined if called in response to > Note: The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value `UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery. depending on the order of notification delivery.
*/ */
@@ -1350,7 +1354,7 @@ MLN_EXPORT
including the entire coordinate bounds. The initial camera's pitch and including the entire coordinate bounds. The initial camera's pitch and
direction will be honored. direction will be honored.
@note The behavior of this method is undefined if called in response to > Note: The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value `UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery. depending on the order of notification delivery.
*/ */
@@ -1371,7 +1375,7 @@ MLN_EXPORT
(close to the ground) as possible while still including the entire shape. (close to the ground) as possible while still including the entire shape.
The initial camera's pitch and direction will be honored. The initial camera's pitch and direction will be honored.
@note The behavior of this method is undefined if called in response to > Note: The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value `UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery. depending on the order of notification delivery.
*/ */
@@ -1392,7 +1396,7 @@ MLN_EXPORT
(close to the ground) as possible while still including the entire shape. (close to the ground) as possible while still including the entire shape.
The camera object uses the current pitch. The camera object uses the current pitch.
@note The behavior of this method is undefined if called in response to > Note: The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value `UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery. depending on the order of notification delivery.
*/ */
@@ -1407,7 +1411,7 @@ MLN_EXPORT
For example, a pinch-to-zoom gesture would anchor the map at the midpoint of For example, a pinch-to-zoom gesture would anchor the map at the midpoint of
the pinch. the pinch.
If the `userTrackingMode` property is not `MLNUserTrackingModeNone`, the If the ``userTrackingMode`` property is not ``MLNUserTrackingMode/MLNUserTrackingModeNone``, the
user annotation is used as the anchor point. user annotation is used as the anchor point.
Subclasses may override this method to provide specialized behavior - for Subclasses may override this method to provide specialized behavior - for
@@ -1434,7 +1438,7 @@ MLN_EXPORT
property may be overridden at any time. property may be overridden at any time.
The usage of `automaticallyAdjustsScrollViewInsets` has been deprecated The usage of `automaticallyAdjustsScrollViewInsets` has been deprecated
use the map view’s property `MLNMapView.automaticallyAdjustsContentInset`instead. use the map view’s property ``MLNMapView/automaticallyAdjustsContentInset``instead.
Changing the value of this property updates the map view immediately. If you Changing the value of this property updates the map view immediately. If you
want to animate the change, use the `-setContentInset:animated:completionHandler:` want to animate the change, use the `-setContentInset:animated:completionHandler:`
@@ -1470,7 +1474,7 @@ MLN_EXPORT
property may be overridden at any time. property may be overridden at any time.
The usage of `automaticallyAdjustsScrollViewInsets` has been deprecated The usage of `automaticallyAdjustsScrollViewInsets` has been deprecated
use the map view’s property `MLNMapView.automaticallyAdjustsContentInset`instead. use the map view’s property ``MLNMapView/automaticallyAdjustsContentInset``instead.
To specify a completion handler to execute after the animation finishes, use To specify a completion handler to execute after the animation finishes, use
the `-setContentInset:animated:completionHandler:` method. the `-setContentInset:animated:completionHandler:` method.
@@ -1500,7 +1504,7 @@ MLN_EXPORT
property may be overridden at any time. property may be overridden at any time.
The usage of `automaticallyAdjustsScrollViewInsets` has been deprecated The usage of `automaticallyAdjustsScrollViewInsets` has been deprecated
use the map view’s property `MLNMapView.automaticallyAdjustsContentInset`instead. use the map view’s property ``MLNMapView/automaticallyAdjustsContentInset``instead.
@param contentInset The new values to inset the content by. @param contentInset The new values to inset the content by.
@param animated Specify `YES` if you want the map view to animate the change to @param animated Specify `YES` if you want the map view to animate the change to
@@ -1601,7 +1605,7 @@ MLN_EXPORT
/** /**
The complete list of annotations associated with the receiver. (read-only) 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 annotations are associated with the map view, the value of this property is
`nil`. `nil`.
*/ */
@@ -1610,32 +1614,32 @@ MLN_EXPORT
/** /**
Adds an annotation to the map view. Adds an annotation to the map view.
@note `MLNMultiPolyline`, `MLNMultiPolygon`, `MLNShapeCollection`, and > Note: ``MLNMultiPolyline``, ``MLNMultiPolyline``, ``MLNMultiPolyline``, and
`MLNPointCollection` objects cannot be added to the map view at this time. ``MLNPointCollection`` objects cannot be added to the map view at this time.
Any multipoint, multipolyline, multipolygon, shape or point collection Any multipoint, multipolyline, multipolygon, shape or point collection
object that is specified is silently ignored. object that is specified is silently ignored.
@param annotation The annotation object to add to the receiver. This object @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. annotation object.
#### Related examples #### Related examples
- TODO: add a line annotation from GeoJSON. - TODO: add a line annotation from GeoJSON.
- TODO: add an annotation to an `MLNMapView` object. - TODO: add an annotation to an ``MLNMapView`` object.
*/ */
- (void)addAnnotation:(id<MLNAnnotation>)annotation; - (void)addAnnotation:(id<MLNAnnotation>)annotation;
/** /**
Adds an array of annotations to the map view. Adds an array of annotations to the map view.
@note `MLNMultiPolyline`, `MLNMultiPolygon`, and `MLNShapeCollection` objects > Note: ``MLNMultiPolyline``, ``MLNMultiPolyline``, and ``MLNMultiPolyline`` objects
cannot be added to the map view at this time. Nor can `MLNMultiPoint` cannot be added to the map view at this time. Nor can ``MLNMultiPoint``
objects that are not instances of `MLNPolyline` or `MLNPolygon`. Any objects that are not instances of ``MLNPolyline`` or ``MLNPolyline``. Any
multipoint, multipolyline, multipolygon, or shape collection objects that multipoint, multipolyline, multipolygon, or shape collection objects that
are specified are silently ignored. are specified are silently ignored.
@param annotations An array of annotation objects. Each object in the array @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. individual annotation object.
*/ */
- (void)addAnnotations:(NSArray<id<MLNAnnotation>> *)annotations; - (void)addAnnotations:(NSArray<id<MLNAnnotation>> *)annotations;
@@ -1648,7 +1652,7 @@ MLN_EXPORT
this method only when you want to hide or delete a given annotation. this method only when you want to hide or delete a given annotation.
@param annotation The annotation object to remove. This object must conform @param annotation The annotation object to remove. This object must conform
to the `MLNAnnotation` protocol to the ``MLNAnnotation`` protocol
*/ */
- (void)removeAnnotation:(id<MLNAnnotation>)annotation; - (void)removeAnnotation:(id<MLNAnnotation>)annotation;
@@ -1661,23 +1665,23 @@ MLN_EXPORT
call this method only when you want to hide or delete the given annotations. call 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 @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; - (void)removeAnnotations:(NSArray<id<MLNAnnotation>> *)annotations;
/** /**
Returns an `MLNAnnotationView` if the given annotation is currently associated Returns an ``MLNAnnotationView`` if the given annotation is currently associated
with a view, otherwise nil. with a view, otherwise nil.
@param annotation The annotation associated with the view. @param annotation The annotation associated with the view.
Annotation must conform to the `MLNAnnotation` protocol. Annotation must conform to the ``MLNAnnotation`` protocol.
*/ */
- (nullable MLNAnnotationView *)viewForAnnotation:(id<MLNAnnotation>)annotation; - (nullable MLNAnnotationView *)viewForAnnotation:(id<MLNAnnotation>)annotation;
/** /**
Returns a reusable annotation image object associated with its identifier. 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 objects for identical-looking annotations in your map views. Dequeueing
saves time and memory during performance-critical operations such as saves time and memory during performance-critical operations such as
scrolling. scrolling.
@@ -1690,7 +1694,7 @@ MLN_EXPORT
#### Related examples #### Related examples
- TODO: Add annotation views and images: learn how to most efficiently - TODO: Add annotation views and images: learn how to most efficiently
reuse an `MLNAnnotationImage`. reuse an ``MLNAnnotationImage``.
*/ */
- (nullable __kindof MLNAnnotationImage *)dequeueReusableAnnotationImageWithIdentifier: - (nullable __kindof MLNAnnotationImage *)dequeueReusableAnnotationImageWithIdentifier:
(NSString *)identifier; (NSString *)identifier;
@@ -1698,7 +1702,7 @@ MLN_EXPORT
/** /**
Returns a reusable annotation view object associated with its identifier. Returns a reusable annotation view object associated with its identifier.
For performance reasons, you should generally reuse `MLNAnnotationView` For performance reasons, you should generally reuse ``MLNAnnotationView``
objects for identical-looking annotations in your map views. Dequeueing objects for identical-looking annotations in your map views. Dequeueing
saves time and memory during performance-critical operations such as saves time and memory during performance-critical operations such as
scrolling. scrolling.
@@ -1716,7 +1720,7 @@ MLN_EXPORT
The complete list of annotations associated with the receiver that are The complete list of annotations associated with the receiver that are
currently visible. 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 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`. with the map view are currently visible, the value of this property is `nil`.
*/ */
@@ -1727,7 +1731,7 @@ MLN_EXPORT
the given rectangle. the given rectangle.
@param rect A rectangle expressed in the map view’s coordinate system. @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 no annotations associated with the map view are currently visible in the
rectangle. rectangle.
*/ */
@@ -1741,11 +1745,11 @@ MLN_EXPORT
Assigning a new array to this property selects only the first annotation in Assigning a new array to this property selects only the first annotation in
the array. the array.
If the annotation is of type `MLNPointAnnotation` and is offscreen, the camera If the annotation is of type ``MLNPointAnnotation`` and is offscreen, the camera
will animate to bring the annotation and its callout just on screen. If you will animate to bring the annotation and its callout just on screen. If you
need finer control, consider using `-selectAnnotation:animated:`. need finer control, consider using `-selectAnnotation:animated:`.
@note In versions prior to `4.0.0` if the annotation was offscreen it was not > Note: In versions prior to `4.0.0` if the annotation was offscreen it was not
selected. selected.
*/ */
@property (nonatomic, copy) NSArray<id<MLNAnnotation>> *selectedAnnotations; @property (nonatomic, copy) NSArray<id<MLNAnnotation>> *selectedAnnotations;
@@ -1761,8 +1765,8 @@ MLN_EXPORT
| `NO` | The annotation is selected, and the callout is presented. However the map is | `NO` | The annotation is selected, and the callout is presented. However the map is
not panned to bring the annotation or callout into view. The presentation of the callout is NOT not panned to bring the annotation or callout into view. The presentation of the callout is NOT
animated. | | `YES` | The annotation is selected, and the callout is presented. If the animated. | | `YES` | The annotation is selected, and the callout is presented. If the
annotation is not visible (or is partially visible) *and* is of type `MLNPointAnnotation`, the map annotation is not visible (or is partially visible) *and* is of type ``MLNPointAnnotation``, the
is panned so that the annotation and its callout are brought into view. The annotation is *not* map is panned so that the annotation and its callout are brought into view. The annotation is *not*
centered within the viewport. | centered within the viewport. |
Note that a selection initiated by a single tap gesture is always animated. Note that a selection initiated by a single tap gesture is always animated.
@@ -1773,7 +1777,7 @@ MLN_EXPORT
@param annotation The annotation object to select. @param annotation The annotation object to select.
@param animated If `YES`, the annotation and callout view are animated on-screen. @param animated If `YES`, the annotation and callout view are animated on-screen.
@note In versions prior to `4.0.0` selecting an offscreen annotation did not > Note: In versions prior to `4.0.0` selecting an offscreen annotation did not
change the camera. change the camera.
*/ */
- (void)selectAnnotation:(id<MLNAnnotation>)annotation - (void)selectAnnotation:(id<MLNAnnotation>)annotation
@@ -1792,8 +1796,8 @@ MLN_EXPORT
| `NO` | The annotation is selected, and the callout is presented. However the map is | `NO` | The annotation is selected, and the callout is presented. However the map is
not panned to bring the annotation or callout into view. The presentation of the callout is NOT not panned to bring the annotation or callout into view. The presentation of the callout is NOT
animated. | | `YES` | The annotation is selected, and the callout is presented. If the animated. | | `YES` | The annotation is selected, and the callout is presented. If the
annotation is not visible (or is partially visible) *and* is of type `MLNPointAnnotation`, the map annotation is not visible (or is partially visible) *and* is of type ``MLNPointAnnotation``, the
is panned so that the annotation and its callout are brought into view. The annotation is *not* map is panned so that the annotation and its callout are brought into view. The annotation is *not*
centered within the viewport. | centered within the viewport. |
Note that a selection initiated by a single tap gesture is always animated. Note that a selection initiated by a single tap gesture is always animated.
@@ -1802,7 +1806,7 @@ MLN_EXPORT
@param animated If `YES`, the annotation and callout view are animated on-screen. @param animated If `YES`, the annotation and callout view are animated on-screen.
@param completion The block executed after the animation finishes. @param completion The block executed after the animation finishes.
@note In versions prior to `4.0.0` selecting an offscreen annotation did not > Note: In versions prior to `4.0.0` selecting an offscreen annotation did not
change the camera. change the camera.
*/ */
- (void)selectAnnotation:(id<MLNAnnotation>)annotation - (void)selectAnnotation:(id<MLNAnnotation>)annotation
@@ -1817,7 +1821,7 @@ MLN_EXPORT
@param annotation The annotation object to select. @param annotation The annotation object to select.
@param moveIntoView If the annotation is not visible (or is partially visible) *and* is of type @param moveIntoView If the annotation is not visible (or is partially visible) *and* is of type
`MLNPointAnnotation`, the map is panned so that the annotation and its callout are brought into ``MLNPointAnnotation``, the map is panned so that the annotation and its callout are brought into
view. The annotation is *not* centered within the viewport. view. The annotation is *not* centered within the viewport.
@param animateSelection If `YES`, the annotation's selection state and callout view's presentation @param animateSelection If `YES`, the annotation's selection state and callout view's presentation
are animated. are animated.
@@ -1841,7 +1845,7 @@ MLN_EXPORT
/** /**
The complete list of overlays associated with the receiver. (read-only) 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 overlays are associated with the map view, the value of this property is
empty array. empty array.
*/ */
@@ -1853,7 +1857,7 @@ MLN_EXPORT
To remove an overlay from a map, use the `-removeOverlay:` method. To remove an overlay from a map, use the `-removeOverlay:` method.
@param overlay The overlay object to add. This object must conform to the @param overlay The overlay object to add. This object must conform to the
`MLNOverlay` protocol. */ ``MLNOverlay`` protocol. */
- (void)addOverlay:(id<MLNOverlay>)overlay; - (void)addOverlay:(id<MLNOverlay>)overlay;
/** /**
@@ -1862,7 +1866,7 @@ MLN_EXPORT
To remove multiple overlays from a map, use the `-removeOverlays:` method. To remove multiple overlays from a map, use the `-removeOverlays:` method.
@param overlays An array of objects, each of which must conform to the @param overlays An array of objects, each of which must conform to the
`MLNOverlay` protocol. ``MLNOverlay`` protocol.
*/ */
- (void)addOverlays:(NSArray<id<MLNOverlay>> *)overlays; - (void)addOverlays:(NSArray<id<MLNOverlay>> *)overlays;
@@ -1881,7 +1885,7 @@ MLN_EXPORT
If a given overlay object is not associated with the map view, it is ignored. 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. protocol.
*/ */
- (void)removeOverlays:(NSArray<id<MLNOverlay>> *)overlays; - (void)removeOverlays:(NSArray<id<MLNOverlay>> *)overlays;
@@ -1897,12 +1901,12 @@ MLN_EXPORT
information about searching for map features, see that method’s documentation. information about searching for map features, see that method’s documentation.
@param point A point expressed in the map view’s coordinate system. @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. represent features in the sources used by the current style.
#### Related examples #### Related examples
- TODO: Select a feature within a layer: to learn how to query an - TODO: Select a feature within a layer: to learn how to query an
`MLNMapView` object for visible `MLNFeature` objects. ``MLNMapView`` object for visible ``MLNMapView`` objects.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point - (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point
NS_SWIFT_NAME(visibleFeatures(at:)); NS_SWIFT_NAME(visibleFeatures(at:));
@@ -1921,7 +1925,7 @@ MLN_EXPORT
@param styleLayerIdentifiers A set of strings that correspond to the names @param styleLayerIdentifiers A set of strings that correspond to the names
of layers defined in the current style. Only the features contained in of layers defined in the current style. Only the features contained in
these layers are included in the returned array. 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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point - (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point
@@ -1936,8 +1940,8 @@ MLN_EXPORT
Each object in the returned array represents a feature rendered by the Each object in the returned array represents a feature rendered by the
current style and provides access to attributes specified by the relevant map current style and provides access to attributes specified by the relevant map
content sources. The returned array includes features loaded by content sources. The returned array includes features loaded by
`MLNShapeSource` and `MLNVectorTileSource` objects but does not include ``MLNShapeSource`` and ``MLNShapeSource`` objects but does not include
anything from `MLNRasterTileSource` objects, or from video or canvas sources, anything from ``MLNRasterTileSource`` objects, or from video or canvas sources,
which are unsupported by this SDK. which are unsupported by this SDK.
The returned features are drawn by a style layer in the current style. For The returned features are drawn by a style layer in the current style. For
@@ -1947,7 +1951,7 @@ MLN_EXPORT
property set to `bus`. If you pass a point corresponding to the location of a 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 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 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
`featureAttributes` dictionary has the `maki` key set to `bus` (along with `featureAttributes` dictionary has the `maki` key set to `bus` (along with
other attributes). The dictionary contains only the attributes provided by the other attributes). The dictionary contains only the attributes provided by the
tile source; it does not include computed attribute values or rules about how tile source; it does not include computed attribute values or rules about how
@@ -1970,28 +1974,21 @@ MLN_EXPORT
Only visible features are returned. To obtain features regardless of Only visible features are returned. To obtain features regardless of
visibility, use the visibility, use the
`-[MLNVectorTileSource featuresInSourceLayersWithIdentifiers:predicate:]` and ``MLNVectorTileSource/featuresInSourceLayersWithIdentifiers:predicate:`` and
`-[MLNShapeSource featuresMatchingPredicate:]` methods on the relevant sources. ``MLNShapeSource/featuresMatchingPredicate:`` methods on the relevant sources.
The returned features may also include features corresponding to annotations. The returned features may also include features corresponding to annotations.
These features are not object-equal to the `MLNAnnotation` objects that were These features are not object-equal to the ``MLNAnnotation`` objects that were
originally added to the map. To query the map for annotations, use originally added to the map. To query the map for annotations, use
`visibleAnnotations` or `-[MLNMapView visibleAnnotationsInRect:]`. `visibleAnnotations` or ``MLNMapView/visibleAnnotationsInRect:``.
@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 point A point expressed in the map view’s coordinate system.
@param styleLayerIdentifiers A set of strings that correspond to the names of @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 defined in the current style. Only the features contained in these
layers are included in the returned array. layers are included in the returned array.
@param predicate A predicate to filter the returned features. @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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point - (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point
@@ -2010,7 +2007,7 @@ MLN_EXPORT
information about searching for map features, see that method’s documentation. information about searching for map features, see that method’s documentation.
@param rect A rectangle expressed in the map view’s coordinate system. @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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect NS_SWIFT_NAME(visibleFeatures(in:)); - (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect NS_SWIFT_NAME(visibleFeatures(in:));
@@ -2029,7 +2026,7 @@ MLN_EXPORT
@param styleLayerIdentifiers A set of strings that correspond to the names of @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 defined in the current style. Only the features contained in these
layers are included in the returned array. 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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect - (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect
@@ -2045,8 +2042,8 @@ MLN_EXPORT
Each object in the returned array represents a feature rendered by the Each object in the returned array represents a feature rendered by the
current style and provides access to attributes specified by the relevant map current style and provides access to attributes specified by the relevant map
content sources. The returned array includes features loaded by content sources. The returned array includes features loaded by
`MLNShapeSource` and `MLNVectorTileSource` objects but does not include ``MLNShapeSource`` and ``MLNShapeSource`` objects but does not include
anything from `MLNRasterTileSource` objects, or from video or canvas sources, anything from ``MLNRasterTileSource`` objects, or from video or canvas sources,
which are unsupported by this SDK. which are unsupported by this SDK.
The returned features are drawn by a style layer in the current style. For The returned features are drawn by a style layer in the current style. For
@@ -2054,7 +2051,7 @@ MLN_EXPORT
but none of the specified style layers includes features that have the `maki` 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 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 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 `featureAttributes` object representing that bus stop is returned and its `featureAttributes`
dictionary has the `maki` key set to `bus` (along with other attributes). The 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 dictionary contains only the attributes provided by the tile source; it does
@@ -2079,31 +2076,15 @@ MLN_EXPORT
Only visible features are returned. To obtain features regardless of Only visible features are returned. To obtain features regardless of
visibility, use the visibility, use the
`-[MLNVectorTileSource featuresInSourceLayersWithIdentifiers:predicate:]` and ``MLNVectorTileSource/featuresInSourceLayersWithIdentifiers:predicate:`` and
`-[MLNShapeSource featuresMatchingPredicate:]` methods on the relevant sources. ``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.
@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 rect A rectangle expressed in the map view’s coordinate system. @param rect A rectangle expressed in the map view’s coordinate system.
@param styleLayerIdentifiers A set of strings that correspond to the names of @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 defined in the current style. Only the features contained in these
layers are included in the returned array. layers are included in the returned array.
@param predicate A predicate to filter the returned features. @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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect - (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect

View File

@@ -306,7 +306,7 @@ const CGFloat MLNAnnotationImagePaddingForCallout = 1;
const CGSize MLNAnnotationAccessibilityElementMinimumSize = CGSizeMake(10, 10); const CGSize MLNAnnotationAccessibilityElementMinimumSize = CGSizeMake(10, 10);
/// The number of view annotations (excluding the user location view) that must /// The number of view annotations (excluding the user location view) that must
/// be descendents of `MLNMapView` before presentsWithTransaction is enabled. /// be descendents of ``MLNMapView`` before presentsWithTransaction is enabled.
static const NSUInteger MLNPresentsWithTransactionAnnotationCount = 0; static const NSUInteger MLNPresentsWithTransactionAnnotationCount = 0;
/// An indication that the requested annotation was not found or is nonexistent. /// An indication that the requested annotation was not found or is nonexistent.
@@ -451,7 +451,7 @@ public:
MLNAnnotationTagContextMap _annotationContextsByAnnotationTag; MLNAnnotationTagContextMap _annotationContextsByAnnotationTag;
MLNAnnotationObjectTagMap _annotationTagsByAnnotation; MLNAnnotationObjectTagMap _annotationTagsByAnnotation;
/// Tag of the selected annotation. If the user location annotation is selected, this ivar is set to `MLNAnnotationTagNotFound`. /// Tag of the selected annotation. If the user location annotation is selected, this ivar is set to ``MLNAnnotationTagNotFound``.
MLNAnnotationTag _selectedAnnotationTag; MLNAnnotationTag _selectedAnnotationTag;
BOOL _userLocationAnnotationIsSelected; BOOL _userLocationAnnotationIsSelected;
@@ -5440,7 +5440,7 @@ static void *windowScreenContext = &windowScreenContext;
// marginInsetsHintForPresentationFromRect: - in this case we need to // marginInsetsHintForPresentationFromRect: - in this case we need to
// ensure that partially off-screen annotations are NOT moved into view. // ensure that partially off-screen annotations are NOT moved into view.
// //
// We may want to create (and fallback to) an `MLNMapViewDelegate` version // We may want to create (and fallback to) an ``MLNMapViewDelegate`` version
// of the `-[MLNCalloutView marginInsetsHintForPresentationFromRect:] // of the `-[MLNCalloutView marginInsetsHintForPresentationFromRect:]
// protocol method. // protocol method.
bounds = CGRectInset(bounds, -calloutPositioningRect.size.width, -calloutPositioningRect.size.height); bounds = CGRectInset(bounds, -calloutPositioningRect.size.width, -calloutPositioningRect.size.height);

View File

@@ -9,9 +9,9 @@ NS_ASSUME_NONNULL_BEGIN
@class MLNUserLocationAnnotationViewStyle; @class MLNUserLocationAnnotationViewStyle;
/** /**
The `MLNMapViewDelegate` protocol defines a set of optional methods that you The ``MLNMapViewDelegate`` protocol defines a set of optional methods that you
can use to receive map-related update messages. Because many map operations can use to receive map-related update messages. Because many map operations
require the `MLNMapView` class to load data asynchronously, the map view calls require the ``MLNMapView`` class to load data asynchronously, the map view calls
these methods to notify your application when specific operations complete. The these methods to notify your application when specific operations complete. The
map view also uses these methods to request information about annotations map view also uses these methods to request information about annotations
displayed on the map, such as the styles and interaction modes to apply to displayed on the map, such as the styles and interaction modes to apply to
@@ -73,7 +73,8 @@ NS_ASSUME_NONNULL_BEGIN
@return A Boolean value indicating whether the map view should stay at @return A Boolean value indicating whether the map view should stay at
`oldCamera` or transition to `newCamera`. `oldCamera` or transition to `newCamera`.
@note If this method is implemented `-mapView:shouldChangeFromCamera:toCamera:` will not be called. > Note: If this method is implemented `-mapView:shouldChangeFromCamera:toCamera:` will not be
called.
*/ */
- (BOOL)mapView:(MLNMapView *)mapView - (BOOL)mapView:(MLNMapView *)mapView
shouldChangeFromCamera:(MLNMapCamera *)oldCamera shouldChangeFromCamera:(MLNMapCamera *)oldCamera
@@ -102,7 +103,7 @@ NS_ASSUME_NONNULL_BEGIN
@param animated Whether the change will cause an animated effect on the map. @param animated Whether the change will cause an animated effect on the map.
@param reason The reason for the camera change. @param reason The reason for the camera change.
@note If this method is implemented `-mapView:regionWillChangeAnimated:` will not be called. > Note: If this method is implemented `-mapView:regionWillChangeAnimated:` will not be called.
*/ */
- (void)mapView:(MLNMapView *)mapView - (void)mapView:(MLNMapView *)mapView
regionWillChangeWithReason:(MLNCameraChangeReason)reason regionWillChangeWithReason:(MLNCameraChangeReason)reason
@@ -113,7 +114,7 @@ NS_ASSUME_NONNULL_BEGIN
This method is called as the currently displayed map camera changes as part of 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 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. `-mapViewDidFinishLoadingMap:` is called.
During the animation, this method may be called many times to report updates to During the animation, this method may be called many times to report updates to
@@ -134,7 +135,7 @@ NS_ASSUME_NONNULL_BEGIN
This method is called as the currently displayed map camera changes as part of 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 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. `-mapViewDidFinishLoadingMap:` is called.
During the animation, this method may be called many times to report updates to During the animation, this method may be called many times to report updates to
@@ -144,7 +145,7 @@ NS_ASSUME_NONNULL_BEGIN
@param mapView The map view whose viewpoint is changing. @param mapView The map view whose viewpoint is changing.
@param reason The reason for the camera change. @param reason The reason for the camera change.
@note If this method is implemented `-mapViewRegionIsChanging:` will not be called. > Note: If this method is implemented `-mapViewRegionIsChanging:` will not be called.
*/ */
- (void)mapView:(MLNMapView *)mapView regionIsChangingWithReason:(MLNCameraChangeReason)reason; - (void)mapView:(MLNMapView *)mapView regionIsChangingWithReason:(MLNCameraChangeReason)reason;
@@ -174,7 +175,7 @@ NS_ASSUME_NONNULL_BEGIN
@param animated Whether the change caused an animated effect on the map. @param animated Whether the change caused an animated effect on the map.
@param reason The reason for the camera change. @param reason The reason for the camera change.
@note If this method is implemented `-mapView:regionDidChangeAnimated:` will not be called. > Note: If this method is implemented `-mapView:regionDidChangeAnimated:` will not be called.
*/ */
- (void)mapView:(MLNMapView *)mapView - (void)mapView:(MLNMapView *)mapView
regionDidChangeWithReason:(MLNCameraChangeReason)reason regionDidChangeWithReason:(MLNCameraChangeReason)reason
@@ -301,7 +302,7 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
Tells the delegate that the `mapView` is missing an image. The image should be added synchronously 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. 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. @param mapView The map view that is loading the image.
@@ -362,8 +363,8 @@ NS_ASSUME_NONNULL_BEGIN
While the `showsUserLocation` property is set to `YES`, this method is called 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 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 called if the map view’s user tracking mode is set to
`MLNUserTrackingModeFollowWithHeading` and the heading changes, or if it is set ``MLNUserTrackingMode/MLNUserTrackingModeFollowWithHeading`` and the heading changes, or if it is
to `MLNUserTrackingModeFollowWithCourse` and the course changes. set to ``MLNUserTrackingMode/MLNUserTrackingModeFollowWithCourse`` and the course changes.
This method is not called if the application is currently running in the 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. If you want to receive location updates while running in the
@@ -407,8 +408,8 @@ NS_ASSUME_NONNULL_BEGIN
When unimplemented, the user location annotation is aligned within the center of When unimplemented, the user location annotation is aligned within the center of
the map view with respect to the content insets. the map view with respect to the content insets.
This method will override any values set by `MLNMapView.userLocationVerticalAlignment` This method will override any values set by ``MLNMapView/userLocationVerticalAlignment``
or `-[MLNMapView setUserLocationVerticalAlignment:animated:]`. or ``MLNMapView/setUserLocationVerticalAlignment:animated:``.
@param mapView The map view that is tracking the user's location. @param mapView The map view that is tracking the user's location.
*/ */
@@ -452,7 +453,7 @@ NS_ASSUME_NONNULL_BEGIN
TODO: Annotation models TODO: Annotation models
TODO: Add annotation views and images TODO: Add annotation views and images
TODO: Mark a place on the map with an image, learn to specify which TODO: Mark a place on the map with an image, learn to specify which
image should be used for `MLNAnnotation` objects that have been added to image should be used for ``MLNAnnotation`` objects that have been added to
your map your map
*/ */
- (nullable MLNAnnotationImage *)mapView:(MLNMapView *)mapView - (nullable MLNAnnotationImage *)mapView:(MLNMapView *)mapView
@@ -490,7 +491,7 @@ NS_ASSUME_NONNULL_BEGIN
#### Related examples #### Related examples
TODO: Annotation models, learn how to modify the outline color of an TODO: Annotation models, learn how to modify the outline color of an
`MLNShape` object that has been added to your map as an annotation. ``MLNShape`` object that has been added to your map as an annotation.
*/ */
- (UIColor *)mapView:(MLNMapView *)mapView strokeColorForShapeAnnotation:(MLNShape *)annotation; - (UIColor *)mapView:(MLNMapView *)mapView strokeColorForShapeAnnotation:(MLNShape *)annotation;
@@ -509,7 +510,7 @@ NS_ASSUME_NONNULL_BEGIN
#### Related examples #### Related examples
TODO: Add a polygon annotation, learn how to modify the color of a an TODO: Add a polygon annotation, learn how to modify the color of a an
`MLNPolygon` at runtime. ``MLNPolygon`` at runtime.
*/ */
- (UIColor *)mapView:(MLNMapView *)mapView fillColorForPolygonAnnotation:(MLNPolygon *)annotation; - (UIColor *)mapView:(MLNMapView *)mapView fillColorForPolygonAnnotation:(MLNPolygon *)annotation;
@@ -525,7 +526,7 @@ NS_ASSUME_NONNULL_BEGIN
#### Related examples #### Related examples
TODO: Add a line annotation from GeoJSON, learn how to modify the TODO: Add a line annotation from GeoJSON, learn how to modify the
line width of an `MLNPolylineFeature` on your map. line width of an ``MLNPolylineFeature`` on your map.
*/ */
- (CGFloat)mapView:(MLNMapView *)mapView lineWidthForPolylineAnnotation:(MLNPolyline *)annotation; - (CGFloat)mapView:(MLNMapView *)mapView lineWidthForPolylineAnnotation:(MLNPolyline *)annotation;
@@ -544,8 +545,8 @@ NS_ASSUME_NONNULL_BEGIN
and draw more quickly than annotation views. and draw more quickly than annotation views.
The user location annotation view can also be customized via this method. When The user location annotation view can also be customized via this method. When
`annotation` is an instance of `MLNUserLocation` (or equal to the map view’s `annotation` is an instance of ``MLNUserLocation`` (or equal to the map view’s
`userLocation` property), return an instance of `MLNUserLocationAnnotationView` `userLocation` property), return an instance of ``MLNUserLocationAnnotationView``
(or a subclass thereof). (or a subclass thereof).
@param mapView The map view that requested the annotation view. @param mapView The map view that requested the annotation view.
@@ -556,7 +557,7 @@ NS_ASSUME_NONNULL_BEGIN
#### Related examples #### Related examples
TODO: Add annotation views and images, learn how to specify what TODO: Add annotation views and images, learn how to specify what
`MLNViewAnnotation` to use for a given `MLNPointAnnotation` object on your ``MLNAnnotation`` to use for a given ``MLNAnnotation`` object on your
map. map.
*/ */
- (nullable MLNAnnotationView *)mapView:(MLNMapView *)mapView - (nullable MLNAnnotationView *)mapView:(MLNMapView *)mapView
@@ -570,7 +571,7 @@ NS_ASSUME_NONNULL_BEGIN
implement this method to animate the addition of the annotation views. implement this method to animate the addition of the annotation views.
@param mapView The map view to which the annotation views were added. @param mapView The map view to which the annotation views were added.
@param annotationViews An array of `MLNAnnotationView` objects representing the @param annotationViews An array of ``MLNAnnotationView`` objects representing the
views that were added. views that were added.
*/ */
- (void)mapView:(MLNMapView *)mapView - (void)mapView:(MLNMapView *)mapView
@@ -684,7 +685,7 @@ NS_ASSUME_NONNULL_BEGIN
TODO: Add annotation views and images TODO: Add annotation views and images
TODO: Display custom views as callouts TODO: Display custom views as callouts
TODO: Default callout usage, learn how to show callouts for TODO: Default callout usage, learn how to show callouts for
`MLNAnnotation` objects. ``MLNAnnotation`` objects.
*/ */
- (BOOL)mapView:(MLNMapView *)mapView annotationCanShowCallout:(id<MLNAnnotation>)annotation; - (BOOL)mapView:(MLNMapView *)mapView annotationCanShowCallout:(id<MLNAnnotation>)annotation;
@@ -700,12 +701,12 @@ NS_ASSUME_NONNULL_BEGIN
@param mapView The map view that requested the callout view. @param mapView The map view that requested the callout view.
@param annotation The object representing the annotation. @param annotation The object representing the annotation.
@return A view conforming to the `MLNCalloutView` protocol, or `nil` to use the @return A view conforming to the ``MLNCalloutView`` protocol, or `nil` to use the
default callout view. default callout view.
#### Related examples #### Related examples
TODO: Display custom views as callouts, learn how to customize an TODO: Display custom views as callouts, learn how to customize an
`MLNAnnotation` object's `MLNCalloutView`. ``MLNAnnotation`` object's ``MLNAnnotation``.
*/ */
- (nullable id<MLNCalloutView>)mapView:(MLNMapView *)mapView - (nullable id<MLNCalloutView>)mapView:(MLNMapView *)mapView
calloutViewForAnnotation:(id<MLNAnnotation>)annotation; calloutViewForAnnotation:(id<MLNAnnotation>)annotation;
@@ -788,7 +789,7 @@ NS_ASSUME_NONNULL_BEGIN
If your custom accessory views are not descendants of the `UIControl` class, If your custom accessory views are not descendants of the `UIControl` class,
the map view does not call this method. If the annotation has a custom callout the map view does not call this method. If the annotation has a custom callout
view via the `-mapView:calloutViewForAnnotation:` method, you can specify the view via the `-mapView:calloutViewForAnnotation:` method, you can specify the
custom accessory views using the `MLNCalloutView` protocol’s custom accessory views using the ``MLNCalloutView`` protocol’s
`leftAccessoryView` and `rightAccessoryView` properties. `leftAccessoryView` and `rightAccessoryView` properties.
@param mapView The map view containing the specified annotation. @param mapView The map view containing the specified annotation.
@@ -810,7 +811,7 @@ NS_ASSUME_NONNULL_BEGIN
opposed to the callout’s left or right accessory view. If the annotation has a opposed to the callout’s left or right accessory view. If the annotation has a
custom callout view via the `-mapView:calloutViewForAnnotation:` method, this custom callout view via the `-mapView:calloutViewForAnnotation:` method, this
method is only called whenever the callout view calls its delegate’s method is only called whenever the callout view calls its delegate’s
`-[MLNCalloutViewDelegate calloutViewTapped:]` method. ``MLNCalloutViewDelegate/calloutViewTapped:`` method.
If this method is present on the delegate, the standard callout view’s body If this method is present on the delegate, the standard callout view’s body
momentarily highlights when the user taps it, whether or not this method does momentarily highlights when the user taps it, whether or not this method does
@@ -821,7 +822,7 @@ NS_ASSUME_NONNULL_BEGIN
#### Related examples #### Related examples
TODO: Display custom views as callouts, learn how to trigger an TODO: Display custom views as callouts, learn how to trigger an
action when an `MLNAnnotation`s `MLNCalloutView` is tapped. action when an ``MLNAnnotation``s ``MLNAnnotation`` is tapped.
*/ */
- (void)mapView:(MLNMapView *)mapView tapOnCalloutForAnnotation:(id<MLNAnnotation>)annotation; - (void)mapView:(MLNMapView *)mapView tapOnCalloutForAnnotation:(id<MLNAnnotation>)annotation;

View File

@@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
The MLNUserLocation class defines a specific type of annotation that identifies The MLNUserLocation class defines a specific type of annotation that identifies
the user’s current location. You do not create instances of this class the user’s current location. You do not create instances of this class
directly. Instead, you retrieve an existing `MLNUserLocation` object from the directly. Instead, you retrieve an existing ``MLNUserLocation`` object from the
`userLocation` property of the map view displayed in your application. `userLocation` property of the map view displayed in your application.
#### Related examples #### Related examples
@@ -38,8 +38,8 @@ MLN_EXPORT
The heading of the user location. (read-only) The heading of the user location. (read-only)
This property is `nil` if the user location tracking mode is not This property is `nil` if the user location tracking mode is not
`MLNUserTrackingModeFollowWithHeading` or if ``MLNUserTrackingMode/MLNUserTrackingModeFollowWithHeading`` or if
`MLNMapView.showsUserHeadingIndicator` is disabled. ``MLNMapView/showsUserHeadingIndicator`` is disabled.
*/ */
@property (nonatomic, readonly, nullable) CLHeading *heading; @property (nonatomic, readonly, nullable) CLHeading *heading;

View File

@@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
@class MLNMapView; @class MLNMapView;
@class MLNUserLocation; @class MLNUserLocation;
/** View representing an `MLNUserLocation` on screen. */ /** View representing an ``MLNUserLocation`` on screen. */
MLN_EXPORT MLN_EXPORT
@interface MLNUserLocationAnnotationView : MLNAnnotationView @interface MLNUserLocationAnnotationView : MLNAnnotationView
@@ -51,7 +51,7 @@ MLN_EXPORT
user interaction, a change in the user’s location, when the user tracking mode user interaction, a change in the user’s location, when the user tracking mode
changes, or when the viewport changes. changes, or when the viewport changes.
@note During user interaction with the map, this method may be called many > Note: During user interaction with the map, this method may be called many
times to update the user location annotation. Therefore, your implementation of times to update the user location annotation. Therefore, your implementation of
this method should be as lightweight as possible to avoid negatively affecting this method should be as lightweight as possible to avoid negatively affecting
performance. performance.

View File

@@ -129,7 +129,7 @@ extern NSTimeInterval const kMLNSMCalloutViewRepositionDelayForUIScrollView;
@brief Present a callout layer in the `layer` and pointing at the given rect of the `layer` bounds @brief Present a callout layer in the `layer` and pointing at the given rect of the `layer` bounds
@discussion Same as the view-based presentation, but inserts the callout into a CALayer hierarchy instead. @discussion Same as the view-based presentation, but inserts the callout into a CALayer hierarchy instead.
@note Be aware that you'll have to direct your own touches to any accessory views, since CALayer doesn't relay touch events. > Note: Be aware that you'll have to direct your own touches to any accessory views, since CALayer doesn't relay touch events.
@param rect @c CGRect to present the view from @param rect @c CGRect to present the view from
@param layer layer to 'constrain' the @c constrainedLayer to @param layer layer to 'constrain' the @c constrainedLayer to

View File

@@ -5,8 +5,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/** /**
The `MLNAnnotationImage` class is responsible for presenting point-based The ``MLNAnnotationImage`` class is responsible for presenting point-based
annotations visually on an `MLNMapView` instance. Annotation image objects pair annotations visually on an ``MLNMapView`` instance. Annotation image objects pair
`NSImage` objects with annotation-related metadata. They may be recycled later `NSImage` objects with annotation-related metadata. They may be recycled later
and put into a reuse queue that is maintained by the map view. 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 MLN_EXPORT
@interface MLNAttributionButton : NSButton @interface MLNAttributionButton : NSButton
/// Returns an `MLNAttributionButton` instance with the given info. /// Returns an ``MLNAttributionButton`` instance with the given info.
- (instancetype)initWithAttributionInfo:(MLNAttributionInfo *)info; - (instancetype)initWithAttributionInfo:(MLNAttributionInfo *)info;
/// The URL to open and display as a tooltip. /// 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 An interactive, customizable map view with an interface similar to the one
provided by Apple’s MapKit. 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 manipulate it with standard gestures, animate the map between different
viewpoints, and present information in the form of annotations and overlays. 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 <a href="https://www.mapbox.com/studio/">Mapbox Studio</a> and hosted on
mapbox.com. 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 These basic styles use
<a href="https://www.mapbox.com/developers/vector-tiles/mapbox-streets">Mapbox Streets</a> <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 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 your Mapbox account. They also deter other developers from using your styles
without your permission. without your permission.
Adding your own gesture recognizer to `MLNMapView` will block the corresponding Adding your own gesture recognizer to ``MLNMapView`` will block the corresponding
gesture recognizer built into `MLNMapView`. To avoid conflicts, define which gesture recognizer built into ``MLNMapView``. To avoid conflicts, define which
gesture recognizer takes precedence. For example, you can subclass gesture recognizer takes precedence. For example, you can subclass
`NSClickGestureRecognizer` and override `-[NSGestureRecognizer `NSClickGestureRecognizer` and override `-[NSGestureRecognizer
shouldRequireFailureOfGestureRecognizer:]`, so that your subclass will be invoked only if the shouldRequireFailureOfGestureRecognizer:]`, so that your subclass will be invoked only if the
default `MLNMapView` click gesture recognizer fails: default ``MLNMapView`` click gesture recognizer fails:
```swift ```swift
class MapClickGestureRecognizer: NSClickGestureRecognizer { 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 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`. 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 Because the style loads asynchronously, you should manipulate it in the
`-[MLNMapViewDelegate mapView:didFinishLoadingStyle:]` or ``MLNMapViewDelegate/mapView:didFinishLoadingStyle:`` or
`-[MLNMapViewDelegate mapViewDidFinishLoadingMap:]` method. It is not possible ``MLNMapViewDelegate/mapViewDidFinishLoadingMap:`` method. It is not possible
to manipulate the style before it has finished loading. 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; @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 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 annotations are associated with the map view, the value of this property is
`nil`. `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. Adds an annotation to the map view.
@note `MLNMultiPolyline`, `MLNMultiPolygon`, and `MLNShapeCollection` objects @note ``MLNMultiPolyline``, ``MLNMultiPolyline``, and ``MLNMultiPolyline`` objects
cannot be added to the map view at this time. Nor can `MLNMultiPoint` cannot be added to the map view at this time. Nor can ``MLNMultiPoint``
objects that are not instances of `MLNPolyline` or `MLNPolygon`. Any objects that are not instances of ``MLNPolyline`` or ``MLNPolyline``. Any
multipoint, multipolyline, multipolygon, or shape collection object that is multipoint, multipolyline, multipolygon, or shape collection object that is
specified is silently ignored. specified is silently ignored.
@param annotation The annotation object to add to the receiver. This object @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. annotation object.
*/ */
- (void)addAnnotation:(id<MLNAnnotation>)annotation; - (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. Adds an array of annotations to the map view.
@note `MLNMultiPolyline`, `MLNMultiPolygon`, and `MLNShapeCollection` objects @note ``MLNMultiPolyline``, ``MLNMultiPolyline``, and ``MLNMultiPolyline`` objects
cannot be added to the map view at this time. Nor can `MLNMultiPoint` cannot be added to the map view at this time. Nor can ``MLNMultiPoint``
objects that are not instances of `MLNPolyline` or `MLNPolygon`. Any objects that are not instances of ``MLNPolyline`` or ``MLNPolyline``. Any
multipoint, multipolyline, multipolygon, or shape collection objects that multipoint, multipolyline, multipolygon, or shape collection objects that
are specified are silently ignored. are specified are silently ignored.
@param annotations An array of annotation objects. Each object in the array @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. individual annotation object.
*/ */
- (void)addAnnotations:(NSArray<id<MLNAnnotation>> *)annotations; - (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 The complete list of annotations associated with the receiver that are
currently visible. 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 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`. 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. 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 @param annotation The annotation object to remove. This object must conform to
the `MLNAnnotation` protocol. the ``MLNAnnotation`` protocol.
*/ */
- (void)removeAnnotation:(id<MLNAnnotation>)annotation; - (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. 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 @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; - (void)removeAnnotations:(NSArray<id<MLNAnnotation>> *)annotations;
/** /**
Returns a reusable annotation image object associated with its identifier. 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 objects for identical-looking annotations in your map views. Dequeueing saves
time and memory during performance-critical operations such as scrolling. 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. the given rectangle.
@param rect A rectangle expressed in the map view’s coordinate system. @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 no annotations associated with the map view are currently visible in the
rectangle. 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 Assigning a new array to this property selects only the first annotation in the
array. 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 panned so that the annotation and its callout are brought just onscreen. The
annotation is *not* centered within the viewport. 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. 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 panned so that the annotation and its callout are brought just onscreen. The
annotation is *not* centered within the viewport. 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 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 overlays are associated with the map view, the value of this property is
empty array. 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. To remove an overlay from a map, use the `-removeOverlay:` method.
@param overlay The overlay object to add. This object must conform to the @param overlay The overlay object to add. This object must conform to the
`MLNOverlay` protocol. ``MLNOverlay`` protocol.
*/ */
- (void)addOverlay:(id<MLNOverlay>)overlay; - (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. To remove multiple overlays from a map, use the `-removeOverlays:` method.
@param overlays An array of objects, each of which must conform to the @param overlays An array of objects, each of which must conform to the
`MLNOverlay` protocol. ``MLNOverlay`` protocol.
*/ */
- (void)addOverlays:(NSArray<id<MLNOverlay>> *)overlays; - (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. 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. protocol.
*/ */
- (void)removeOverlays:(NSArray<id<MLNOverlay>> *)overlays; - (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. information about searching for map features, see that method’s documentation.
@param point A point expressed in the map view’s coordinate system. @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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(NSPoint)point - (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 @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 defined in the current style. Only the features contained in these
layers are included in the returned array. 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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(NSPoint)point - (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 Each object in the returned array represents a feature rendered by the
current style and provides access to attributes specified by the relevant map current style and provides access to attributes specified by the relevant map
content sources. The returned array includes features loaded by content sources. The returned array includes features loaded by
`MLNShapeSource` and `MLNVectorTileSource` objects but does not include ``MLNShapeSource`` and ``MLNShapeSource`` objects but does not include
anything from `MLNRasterTileSource` objects, or from video or canvas sources, anything from ``MLNRasterTileSource`` objects, or from video or canvas sources,
which are unsupported by this SDK. which are unsupported by this SDK.
The returned features are drawn by a style layer in the current style. For 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 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 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 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` dictionary has the `maki` key set to `bus` (along with other
attributes). The dictionary contains only the attributes provided by the attributes). The dictionary contains only the attributes provided by the
tile source; it does not include computed attribute values or rules about how 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 Only visible features are returned. To obtain features regardless of
visibility, use the visibility, use the
`-[MLNVectorTileSource featuresInSourceLayersWithIdentifiers:predicate:]` and ``MLNVectorTileSource/featuresInSourceLayersWithIdentifiers:predicate:`` and
`-[MLNShapeSource featuresMatchingPredicate:]` methods on the relevant sources. ``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 point A point expressed in the map view’s coordinate system.
@param styleLayerIdentifiers A set of strings that correspond to the names of @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 defined in the current style. Only the features contained in these
layers are included in the returned array. layers are included in the returned array.
@param predicate A predicate to filter the returned features. @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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(NSPoint)point - (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. information about searching for map features, see that method’s documentation.
@param rect A rectangle expressed in the map view’s coordinate system. @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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(NSRect)rect NS_SWIFT_NAME(visibleFeatures(in:)); - (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 @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 defined in the current style. Only the features contained in these
layers are included in the returned array. 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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(NSRect)rect - (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 Each object in the returned array represents a feature rendered by the
current style and provides access to attributes specified by the relevant map current style and provides access to attributes specified by the relevant map
content sources. The returned array includes features loaded by content sources. The returned array includes features loaded by
`MLNShapeSource` and `MLNVectorTileSource` objects but does not include ``MLNShapeSource`` and ``MLNShapeSource`` objects but does not include
anything from `MLNRasterTileSource` objects, or from video or canvas sources, anything from ``MLNRasterTileSource`` objects, or from video or canvas sources,
which are unsupported by this SDK. which are unsupported by this SDK.
The returned features are drawn by a style layer in the current style. For 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` 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 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 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 object representing that bus stop is returned and its `attributes` dictionary
has the `maki` key set to `bus` (along with other attributes). The 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 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 Only visible features are returned. To obtain features regardless of
visibility, use the visibility, use the
`-[MLNVectorTileSource featuresInSourceLayersWithIdentifiers:predicate:]` and ``MLNVectorTileSource/featuresInSourceLayersWithIdentifiers:predicate:`` and
`-[MLNShapeSource featuresMatchingPredicate:]` methods on the relevant sources. ``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 rect A rectangle expressed in the map view’s coordinate system. @param rect A rectangle expressed in the map view’s coordinate system.
@param styleLayerIdentifiers A set of strings that correspond to the names of @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 defined in the current style. Only the features contained in these
layers are included in the returned array. layers are included in the returned array.
@param predicate A predicate to filter the returned features. @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. represent features in the sources used by the current style.
*/ */
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(NSRect)rect - (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(NSRect)rect

View File

@@ -2431,7 +2431,7 @@ public:
: NSMaxXEdge); : NSMaxXEdge);
// The following will do nothing if the positioning rect is not on-screen. See // 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. // annotation comes back on-screen.
[callout showRelativeToRect:positioningRect ofView:self preferredEdge:edge]; [callout showRelativeToRect:positioningRect ofView:self preferredEdge:edge];
} }

View File

@@ -13,9 +13,9 @@ NS_ASSUME_NONNULL_BEGIN
@protocol MLNAnnotation; @protocol MLNAnnotation;
/** /**
The `MLNMapViewDelegate` protocol defines a set of optional methods that you The ``MLNMapViewDelegate`` protocol defines a set of optional methods that you
can use to receive messages from an `MLNMapView` instance. Because many map can use to receive messages from an ``MLNMapView`` instance. Because many map
operations require the `MLNMapView` class to load data asynchronously, the map operations require the ``MLNMapView`` class to load data asynchronously, the map
view calls these methods to notify your application when specific operations view calls these methods to notify your application when specific operations
complete. The map view also uses these methods to request information about 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 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 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 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. `-mapViewDidFinishLoadingMap:` is called.
During the animation, this method may be called many times to report updates 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 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. 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. @param mapView The map view that is loading the image.
@@ -370,7 +370,7 @@ NS_ASSUME_NONNULL_BEGIN
such as `title` and `subtitle`. such as `title` and `subtitle`.
If each annotation should have an identical callout, you can set the 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 mapView The map view that is requesting a callout view controller.
@param annotation The object representing the annotation. @param annotation The object representing the annotation.