summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Erb <josh.erb@mapbox.com>2018-12-13 16:34:31 -0500
committerJosh Erb <josh.erb@mapbox.com>2019-01-30 11:14:28 -0500
commite16e19629257dd0ba98d2c7a46b5cefb665ccd3a (patch)
tree525f723e866c528349117c62b96c66aef77298a5
parentce37879231514cfc60e66454ca493c2d76765318 (diff)
downloadqtlocation-mapboxgl-upstream/je-ios-code-snippets.tar.gz
[ios][documenation] add additional code snippets to API docsupstream/je-ios-code-snippets
-rw-r--r--platform/darwin/scripts/style-spec-overrides-v8.json2
-rw-r--r--platform/darwin/src/MGLLight.h9
-rw-r--r--platform/darwin/src/MGLOfflinePack.h14
-rw-r--r--platform/darwin/src/MGLShapeOfflineRegion.h14
-rw-r--r--platform/darwin/src/MGLShapeSource.h2
-rw-r--r--platform/darwin/src/MGLTilePyramidOfflineRegion.h11
-rw-r--r--platform/darwin/test/MGLDocumentationExampleTests.swift78
-rw-r--r--platform/ios/src/MGLMapView.h104
8 files changed, 180 insertions, 54 deletions
diff --git a/platform/darwin/scripts/style-spec-overrides-v8.json b/platform/darwin/scripts/style-spec-overrides-v8.json
index c98c61f71d..0ba2b77dc5 100644
--- a/platform/darwin/scripts/style-spec-overrides-v8.json
+++ b/platform/darwin/scripts/style-spec-overrides-v8.json
@@ -1,5 +1,5 @@
{
- "light-cocoa-doc": "An `MGLLight` object represents the light source for extruded geometries in `MGLStyle`.\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 `MGLLight` object represents the light source for extruded geometries in `MGLStyle`.\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": {
"position": {
"doc": "Position of the `MGLLight` source relative to lit (extruded) geometries, in a `MGLSphericalPosition` 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 `MGLLight.anchor` is set to `MGLLightAnchorViewport` corresponds to the top of the viewport, or 0° when `MGLLight.anchor` is set to `MGLLightAnchorMap` corresponds to due north, and degrees proceed clockwise), and polar indicates the height of the light (from 0°, directly above, to 180°, directly below).",
diff --git a/platform/darwin/src/MGLLight.h b/platform/darwin/src/MGLLight.h
index 9694a18d0f..281fcc5c6e 100644
--- a/platform/darwin/src/MGLLight.h
+++ b/platform/darwin/src/MGLLight.h
@@ -60,6 +60,15 @@ NS_INLINE MGLSphericalPosition MGLSphericalPositionMake(CGFloat radial, CLLocati
An `MGLLight` object represents the light source for extruded geometries in
`MGLStyle`.
+ ### Example
+ ```swift
+ let light = MGLLight()
+ let position = MGLSphericalPosition(radial: 5, azimuthal: 180, polar: 80)
+ light.position = NSExpression(forConstantValue: NSValue(mglSphericalPosition: position))
+ light.anchor = NSExpression(forConstantValue: "map")
+ mapView.style?.light = light
+ ```
+
#### Related examples
See the <a
href="https://docs.mapbox.com/ios/maps/examples/light-example/">Adjust light of
diff --git a/platform/darwin/src/MGLOfflinePack.h b/platform/darwin/src/MGLOfflinePack.h
index 3d22f74e72..7b241e0248 100644
--- a/platform/darwin/src/MGLOfflinePack.h
+++ b/platform/darwin/src/MGLOfflinePack.h
@@ -103,6 +103,20 @@ typedef struct __attribute__((objc_boxable)) MGLOfflinePackProgress {
To create an instance of `MGLOfflinePack`, use the
`+[MGLOfflineStorage addPackForRegion:withContext:completionHandler:]` method.
A pack created using `-[MGLOfflinePack init]` is immediately invalid.
+
+ ### Example
+ ```swift
+ MGLOfflineStorage.shared.addPack(for: region, withContext: context!) { (pack, error) in
+ guard error == nil else {
+ // If download fails, log the error to the console
+ print("Error: \(error?.localizedDescription ?? "unknown error")")
+ return
+ }
+
+ // Start an MGLOfflinePack download
+ pack!.resume()
+ }
+ ```
*/
MGL_EXPORT
@interface MGLOfflinePack : NSObject
diff --git a/platform/darwin/src/MGLShapeOfflineRegion.h b/platform/darwin/src/MGLShapeOfflineRegion.h
index ac54dc137b..f1def03be8 100644
--- a/platform/darwin/src/MGLShapeOfflineRegion.h
+++ b/platform/darwin/src/MGLShapeOfflineRegion.h
@@ -10,6 +10,20 @@ NS_ASSUME_NONNULL_BEGIN
An offline region defined by a style URL, geographic shape, and
range of zoom levels.
+ ### Example
+ ```swift
+ var coordinates = [
+ CLLocationCoordinate2D(latitude: 45.522585, longitude: -122.685699),
+ CLLocationCoordinate2D(latitude: 45.534611, longitude: -122.708873),
+ CLLocationCoordinate2D(latitude: 45.530883, longitude: -122.678833)
+ ]
+
+ let triangle = MGLPolygon(coordinates: &coordinates, count: UInt(coordinates.count))
+ let region = MGLShapeOfflineRegion(styleURL: MGLStyle.lightStyleURL, shape: triangle, fromZoomLevel: 11, toZoomLevel: 14)
+ let context = "Triangle Region".data(using: .utf8)
+ MGLOfflineStorage.shared.addPack(for: region, withContext: context!)
+ ```
+
This class requires fewer resources than MGLTilePyramidOfflineRegion
for irregularly shaped regions.
*/
diff --git a/platform/darwin/src/MGLShapeSource.h b/platform/darwin/src/MGLShapeSource.h
index 009e8652c9..a57b963c63 100644
--- a/platform/darwin/src/MGLShapeSource.h
+++ b/platform/darwin/src/MGLShapeSource.h
@@ -25,7 +25,7 @@ typedef NSString *MGLShapeSourceOption NS_STRING_ENUM;
This option only affects point features within an `MGLShapeSource` object; it
is ignored when creating an `MGLComputedShapeSource` object.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/clustering/">Cluster point data</a> and <a href="https://docs.mapbox.com/ios/maps/examples/clustering-with-images/">Use images to cluster point data</a> examples to learn how to cluster point data with this `MGLShapeSourceOption`.
*/
diff --git a/platform/darwin/src/MGLTilePyramidOfflineRegion.h b/platform/darwin/src/MGLTilePyramidOfflineRegion.h
index 162636eda0..d04e656230 100644
--- a/platform/darwin/src/MGLTilePyramidOfflineRegion.h
+++ b/platform/darwin/src/MGLTilePyramidOfflineRegion.h
@@ -13,6 +13,17 @@ NS_ASSUME_NONNULL_BEGIN
To minimize the resources required by an irregularly shaped offline region,
use the MGLShapeOfflineRegion class instead.
+ ### Example
+ ```swift
+ let northeast = CLLocationCoordinate2D(latitude: 40.989329, longitude: -102.062592)
+ let southwest = CLLocationCoordinate2D(latitude: 36.986207, longitude: -109.049896)
+ let bbox = MGLCoordinateBounds(sw: southwest, ne: northeast)
+
+ let region = MGLTilePyramidOfflineRegion(styleURL: MGLStyle.lightStyleURL, bounds: bbox, fromZoomLevel: 11, toZoomLevel: 14)
+ let context = "Tile Pyramid Region".data(using: .utf8)
+ MGLOfflineStorage.shared.addPack(for: region, withContext: context!)
+ ```
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/offline-pack/">
Download an offline map</a> example to learn how to define an offline region
diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift
index b59d297f97..9d1d848868 100644
--- a/platform/darwin/test/MGLDocumentationExampleTests.swift
+++ b/platform/darwin/test/MGLDocumentationExampleTests.swift
@@ -47,6 +47,84 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate {
styleLoadingExpectation.fulfill()
}
+ func testMGLLight() {
+ //#-example-code
+ let light = MGLLight()
+ let position = MGLSphericalPosition(radial: 5, azimuthal: 180, polar: 80)
+ light.position = NSExpression(forConstantValue: NSValue(mglSphericalPosition: position))
+ light.anchor = NSExpression(forConstantValue: "map")
+ mapView.style?.light = light
+ //#-end-example-code
+
+ XCTAssertNotNil(mapView.style?.light)
+ }
+
+ func testMGLTilePyramidOfflineRegion() {
+ class MGLStyle {
+ static var lightStyleURL: URL {
+ return MGLDocumentationExampleTests.styleURL
+ }
+ }
+
+ //#-example-code
+ let northeast = CLLocationCoordinate2D(latitude: 40.989329, longitude: -102.062592)
+ let southwest = CLLocationCoordinate2D(latitude: 36.986207, longitude: -109.049896)
+ let bbox = MGLCoordinateBounds(sw: southwest, ne: northeast)
+
+ let region = MGLTilePyramidOfflineRegion(styleURL: MGLStyle.lightStyleURL, bounds: bbox, fromZoomLevel: 11, toZoomLevel: 14)
+ let context = "Tile Pyramid Region".data(using: .utf8)
+ MGLOfflineStorage.shared.addPack(for: region, withContext: context!)
+ //#-end-example-code
+
+ XCTAssertNotNil(region)
+ }
+
+ func testMGLShapeOfflineRegion() {
+ class MGLStyle {
+ static var lightStyleURL: URL {
+ return MGLDocumentationExampleTests.styleURL
+ }
+ }
+
+ //#-example-code
+ var coordinates = [
+ CLLocationCoordinate2D(latitude: 45.522585, longitude: -122.685699),
+ CLLocationCoordinate2D(latitude: 45.534611, longitude: -122.708873),
+ CLLocationCoordinate2D(latitude: 45.530883, longitude: -122.678833)
+ ]
+
+ let triangle = MGLPolygon(coordinates: &coordinates, count: UInt(coordinates.count))
+ let region = MGLShapeOfflineRegion(styleURL: MGLStyle.lightStyleURL, shape: triangle, fromZoomLevel: 11, toZoomLevel: 14)
+ let context = "Triangle Region".data(using: .utf8)
+ MGLOfflineStorage.shared.addPack(for: region, withContext: context!)
+ //#-end-example-code
+
+ XCTAssertNotNil(region)
+ }
+
+ func testMGLOfflinePack() {
+ let northeast = CLLocationCoordinate2D(latitude: 40.989329, longitude: -102.062592)
+ let southwest = CLLocationCoordinate2D(latitude: 36.986207, longitude: -109.049896)
+ let bbox = MGLCoordinateBounds(sw: southwest, ne: northeast)
+ let region = MGLTilePyramidOfflineRegion(styleURL: MGLStyle.lightStyleURL, bounds: bbox, fromZoomLevel: 11, toZoomLevel: 14)
+ let context = "Tile Pyramid Region".data(using: .utf8)
+
+ //#-example-code
+ MGLOfflineStorage.shared.addPack(for: region, withContext: context!) { (pack, error) in
+ guard error == nil else {
+ // If download fails, log the error to the console
+ print("Error: \(error?.localizedDescription ?? "unknown error")")
+ return
+ }
+
+ // Start an MGLOfflinePack download
+ pack!.resume()
+ }
+ //#-end-example-code
+
+ XCTAssertNotNil(region)
+ }
+
func testMGLShape$shapeWithData_encoding_error_() {
let mainBundle = Bundle(for: MGLDocumentationExampleTests.self)
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h
index 57d2e6df48..7980d6aaf5 100644
--- a/platform/ios/src/MGLMapView.h
+++ b/platform/ios/src/MGLMapView.h
@@ -69,7 +69,7 @@ typedef NS_ENUM(NSUInteger, MGLOrnamentPosition) {
/**
The mode used to track the user location on the map. Used with
`MGLMapView.userTrackingMode`.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/user-tracking-mode/">
Switch between user tracking modes</a> example to learn how to toggle modes and
@@ -86,7 +86,7 @@ typedef NS_ENUM(NSUInteger, MGLUserTrackingMode) {
The default user location annotation displays a fan-shaped indicator with
the current heading. The heading indicator represents the direction the
device is facing, which is sized according to the reported accuracy.
-
+
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, this tracking mode will fall back to `MGLUserTrackingModeFollow`.
@@ -97,7 +97,7 @@ typedef NS_ENUM(NSUInteger, MGLUserTrackingMode) {
Course represents the direction in which the device is traveling.
The default user location annotation shows a puck-shaped indicator
that rotates as the course changes.
-
+
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,
this tracking mode will fall back to `MGLUserTrackingModeFollow`.
@@ -152,8 +152,8 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLResourceNotFoundException
Access tokens associate requests to Mapbox’s vector tile and style APIs with
your Mapbox account. They also deter other developers from using your styles
without your permission.
-
- Because `MGLMapView` loads asynchronously, several delegate methods are available
+
+ Because `MGLMapView` loads asynchronously, several delegate methods are available
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
in the `MGLMapViewDelegate` protocol documentation.
@@ -174,7 +174,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLResourceNotFoundException
@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.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/simple-map-view/">
Simple map view</a> example to learn how to initialize a basic `MGLMapView`.
@@ -203,7 +203,7 @@ MGL_EXPORT IB_DESIGNABLE
(`mapbox://styles/{user}/{style}`), or a path to a local file relative
to the application’s resource path. Specify `nil` for the default style.
@return An initialized map view.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/custom-style/">
Apply a style designed in Mapbox Studio</a> example to learn how to
@@ -267,7 +267,7 @@ MGL_EXPORT IB_DESIGNABLE
If you want to modify the current style without replacing it outright, or if
you want to introspect individual style attributes, use the `style` property.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/switch-styles/">
Switch between map styles</a> example to learn how to change the style of
@@ -424,13 +424,13 @@ MGL_EXPORT IB_DESIGNABLE
/**
The object that this map view uses to start and stop the delivery of location-related
updates.
-
+
To receive the current user location, implement the `-[MGLMapViewDelegate mapView:didUpdateUserLocation:]`
and `-[MGLMapViewDelegate mapView:didFailToLocateUserWithError:]` methods.
-
+
If setting this property to `nil` or if no custom manager is provided this property
is set to the default location manager.
-
+
`MGLMapView` uses a default location manager. If you want to substitute your own
location manager, you should do so by setting this property before setting
`showsUserLocation` to `YES`. To restore the default location manager,
@@ -454,7 +454,7 @@ MGL_EXPORT IB_DESIGNABLE
`NSLocationAlwaysUsageDescription` in its `Info.plist` to satisfy the
requirements of the underlying Core Location framework when enabling this
property.
-
+
If you implement a custom location manager, set the `locationManager` before
calling `showsUserLocation`.
*/
@@ -481,7 +481,7 @@ MGL_EXPORT IB_DESIGNABLE
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
`-setUserTrackingMode:animated:` method instead.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/user-location-annotation/">
Customize the user location annotation</a> to learn how to customize the
@@ -698,12 +698,12 @@ MGL_EXPORT IB_DESIGNABLE
Changing the center coordinate centers the map on the new coordinate without
changing the current zoom level.
-
+
@param coordinate The new center coordinate for the map.
@param animated Specify `YES` if you want the map view to scroll to the new
location or `NO` if you want the map to display the new location
immediately.
-
+
@note The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`.
*/
@@ -718,7 +718,7 @@ MGL_EXPORT IB_DESIGNABLE
@param animated Specify `YES` if you want the map view to animate scrolling and
zooming to the new location or `NO` if you want the map to display the new
location immediately.
-
+
@note The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`.
*/
@@ -735,7 +735,7 @@ MGL_EXPORT IB_DESIGNABLE
@param animated Specify `YES` if you want the map view to animate scrolling,
zooming, and rotating to the new location or `NO` if you want the map to
display the new location immediately.
-
+
@note The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`.
*/
@@ -753,7 +753,7 @@ MGL_EXPORT IB_DESIGNABLE
zooming, and rotating to the new location or `NO` if you want the map to
display the new location immediately.
@param completion The block executed after the animation finishes.
-
+
@note The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`.
*/
@@ -855,7 +855,7 @@ MGL_EXPORT IB_DESIGNABLE
Changing the value of this property updates the receiver immediately. If you
want to animate the change, call `-setVisibleCoordinateBounds:animated:`
instead.
-
+
If a longitude is less than −180 degrees or greater than 180 degrees, the
visible bounds straddles the antimeridian or international date line. For
example, if both Tokyo and San Francisco are visible, the visible bounds might
@@ -866,7 +866,7 @@ MGL_EXPORT IB_DESIGNABLE
/**
Changes the receiver’s viewport to fit the given coordinate bounds,
optionally animating the change.
-
+
To bring both sides of the antimeridian or international date line into view,
specify some longitudes less than −180 degrees or greater than 180 degrees. For
example, to show both Tokyo and San Francisco simultaneously, you could set the
@@ -881,7 +881,7 @@ MGL_EXPORT IB_DESIGNABLE
/**
Changes the receiver’s viewport to fit the given coordinate bounds and
optionally some additional padding on each side.
-
+
To bring both sides of the antimeridian or international date line into view,
specify some longitudes less than −180 degrees or greater than 180 degrees. For
example, to show both Tokyo and San Francisco simultaneously, you could set the
@@ -898,7 +898,7 @@ MGL_EXPORT IB_DESIGNABLE
/**
Changes the receiver’s viewport to fit all of the given coordinates and
optionally some additional padding on each side.
-
+
To bring both sides of the antimeridian or international date line into view,
specify some longitudes less than −180 degrees or greater than 180 degrees. For
example, to show both Tokyo and San Francisco simultaneously, you could set the
@@ -917,7 +917,7 @@ MGL_EXPORT IB_DESIGNABLE
/**
Changes the receiver’s viewport to fit all of the given coordinates and
optionally some additional padding on each side.
-
+
To bring both sides of the antimeridian or international date line into view,
specify some longitudes less than −180 degrees or greater than 180 degrees. For
example, to show both Tokyo and San Francisco simultaneously, you could set the
@@ -978,7 +978,7 @@ MGL_EXPORT IB_DESIGNABLE
@param animated Specify `YES` if you want the map view to animate the change to
the new viewpoint or `NO` if you want the map to display the new viewpoint
immediately.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/camera-animation/">
Camera animation</a> example to learn how to trigger an animation that
@@ -997,7 +997,7 @@ MGL_EXPORT IB_DESIGNABLE
@param function A timing function used for the animation. Set this parameter to
`nil` for a transition that matches most system animations. If the duration
is `0`, this parameter is ignored.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/camera-animation/">
Camera animation</a> example to learn how to create a timed animation that
@@ -1023,7 +1023,7 @@ MGL_EXPORT IB_DESIGNABLE
/**
Moves the viewpoint to a different location with respect to the map with an
optional transition duration and timing function.
-
+
@param camera The new viewpoint.
@param duration The amount of time, measured in seconds, that the transition
animation should take. Specify `0` to jump to the new viewpoint
@@ -1112,7 +1112,7 @@ MGL_EXPORT IB_DESIGNABLE
with zoom level as high (close to the ground) as possible while still
including the entire coordinate bounds. The camera object uses the current
direction and pitch.
-
+
@note The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery.
@@ -1122,7 +1122,7 @@ MGL_EXPORT IB_DESIGNABLE
/**
Returns the camera that best fits the given coordinate bounds, with the specified camera,
optionally with some additional padding on each side.
-
+
@param camera The camera that the return camera should adhere to. All values
on this camera will be manipulated except for pitch and direction.
@param bounds The coordinate bounds to fit to the receiver’s viewport.
@@ -1142,7 +1142,7 @@ MGL_EXPORT IB_DESIGNABLE
/**
Returns the camera that best fits the given shape, with the specified camera,
optionally with some additional padding on each side.
-
+
@param camera The camera that the return camera should adhere to. All values
on this camera will be manipulated except for pitch and direction.
@param shape The shape to fit to the receiver’s viewport.
@@ -1151,7 +1151,7 @@ MGL_EXPORT IB_DESIGNABLE
@return A camera object centered on the shape's center with zoom level as high
(close to the ground) as possible while still including the entire shape. The
initial camera's pitch and direction will be honored.
-
+
@note The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery.
@@ -1166,10 +1166,10 @@ MGL_EXPORT IB_DESIGNABLE
@param direction The direction of the viewport, measured in degrees clockwise from true north.
@param insets The minimum padding (in screen points) that would be visible
around the returned camera object if it were set as the receiver’s camera.
- @return A camera object centered on the shape's center with zoom level as high
+ @return A camera object centered on the shape's center with zoom level as high
(close to the ground) as possible while still including the entire shape. The
camera object uses the current pitch.
-
+
@note The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery.
@@ -1245,7 +1245,7 @@ MGL_EXPORT IB_DESIGNABLE
@param point The point to convert.
@param view The view in whose coordinate system the point is expressed.
@return The geographic coordinate at the given point.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/point-conversion/">
Point conversion</a> example to learn how to convert a `CGPoint` to a map
@@ -1264,7 +1264,7 @@ MGL_EXPORT IB_DESIGNABLE
belong to the same window as the map view.
@return The point (in the appropriate view or window coordinate system)
corresponding to the given geographic coordinate.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/point-conversion/">
Point conversion</a> example to learn how to convert a map coordinate to a
@@ -1275,7 +1275,7 @@ MGL_EXPORT IB_DESIGNABLE
/**
Converts a rectangle in the given view’s coordinate system to a geographic
bounding box.
-
+
If the returned coordinate bounds contains a longitude is less than −180 degrees
or greater than 180 degrees, the bounding box straddles the antimeridian or
international date line.
@@ -1289,7 +1289,7 @@ MGL_EXPORT IB_DESIGNABLE
/**
Converts a geographic bounding box to a rectangle in the given view’s
coordinate system.
-
+
To bring both sides of the antimeridian or international date line into view,
specify some longitudes less than −180 degrees or greater than 180 degrees. For
example, to show both Tokyo and San Francisco simultaneously, you could set the
@@ -1341,7 +1341,7 @@ MGL_EXPORT IB_DESIGNABLE
@param annotation The annotation object to add to the receiver. This object
must conform to the `MGLAnnotation` protocol. The map view retains the
annotation object.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/annotation-models/">
Annotation models</a> and <a href="https://docs.mapbox.com/ios/maps/examples/line-geojson/">
@@ -1412,7 +1412,7 @@ MGL_EXPORT IB_DESIGNABLE
annotation image object using the `-mapView:imageForAnnotation:` method.
@return An annotation image object with the given identifier, or `nil` if no
such object exists in the reuse queue.
-
+
#### Related examples
See the <a href="https://docs.mapbox.com/ios/maps/examples/annotation-view-image/">
Add annotation views and images</a> example learn how to most efficiently
@@ -1479,14 +1479,14 @@ MGL_EXPORT IB_DESIGNABLE
The `animated` parameter determines whether the selection is animated including whether the map is
panned to bring the annotation into view, specifically:
-
+
| `animated` parameter | Effect |
|------------------|--------|
| `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 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 `MGLPointAnnotation`, the map is panned so that the annotation and its callout are brought into view. The annotation is *not* centered within the viewport. |
Note that a selection initiated by a single tap gesture is always animated.
-
+
@param annotation The annotation object to select.
@param animated If `YES`, the annotation and callout view are animated on-screen.
@@ -1499,7 +1499,7 @@ MGL_EXPORT IB_DESIGNABLE
:nodoc:
Selects an annotation and displays its callout view. This method should be
considered "alpha" and as such is liable to change.
-
+
@param annotation The annotation object to select.
@param moveIntoView If the annotation is not visible (or is partially visible) *and* is of type `MGLPointAnnotation`, the map is panned so that the annotation and its callout are brought into view. The annotation is *not* centered within the viewport. |
@param animateSelection If `YES`, the annotation's selection state and callout view's presentation are animated.
@@ -1577,7 +1577,7 @@ MGL_EXPORT IB_DESIGNABLE
@param point A point expressed in the map view’s coordinate system.
@return An array of objects conforming to the `MGLFeature` protocol that
represent features in the sources used by the current style.
-
+
#### Related 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 query an
@@ -1588,18 +1588,18 @@ MGL_EXPORT IB_DESIGNABLE
/**
Returns an array of rendered map features that intersect with a given point,
restricted to the given style layers.
-
+
This method returns all the intersecting features from the specified layers. To
filter the returned features, use the
`-visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:` method. For
more information about searching for map features, see that method’s
documentation.
-
+
@param point A point expressed in the map view’s coordinate system.
- @param styleLayerIdentifiers A set of strings that correspond to the names
- of layers defined in the current style. Only the features contained in
+ @param styleLayerIdentifiers A set of strings that correspond to the names
+ of layers defined in the current style. Only the features contained in
these layers are included in the returned array.
- @return An array of objects conforming to the `MGLFeature` protocol that
+ @return An array of objects conforming to the `MGLFeature` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id <MGLFeature>> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:));
@@ -1689,11 +1689,11 @@ MGL_EXPORT IB_DESIGNABLE
/**
Returns an array of rendered map features that intersect with the given
rectangle, restricted to the given style layers.
-
+
This method returns all the intersecting features from the specified layers. To
filter the returned features, use the
`-visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:` method. For
- more information about searching for map features, see that method’s
+ more information about searching for map features, see that method’s
documentation.
@param rect A rectangle expressed in the map view’s coordinate system.
@@ -1709,7 +1709,7 @@ MGL_EXPORT IB_DESIGNABLE
Returns an array of rendered map features that intersect with the given
rectangle, restricted to the given style layers and filtered by the given
predicate.
-
+
Each object in the returned array represents a feature rendered by the
current style and provides access to attributes specified by the relevant map
content sources. The returned array includes features loaded by
@@ -1758,7 +1758,7 @@ MGL_EXPORT IB_DESIGNABLE
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
@@ -1766,7 +1766,7 @@ MGL_EXPORT IB_DESIGNABLE
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 styleLayerIdentifiers A set of strings that correspond to the names of
layers defined in the current style. Only the features contained in these