diff options
author | Josh Erb <josh.erb@mapbox.com> | 2018-12-13 16:34:31 -0500 |
---|---|---|
committer | Josh Erb <josherb4@gmail.com> | 2019-01-30 13:18:45 -0500 |
commit | 5d891b4b2a7ce4f71bfb5b31a08aafa64db0a003 (patch) | |
tree | 1e93304dc2f5aa3c53c1ec257aa3ea566e513449 /platform/ios/src/MGLMapView.h | |
parent | 8faee2554692ae13da5fbb68d3eef2ebb09a0c86 (diff) | |
download | qtlocation-mapboxgl-5d891b4b2a7ce4f71bfb5b31a08aafa64db0a003.tar.gz |
[ios][documenation] add additional code snippets to API docs
Diffstat (limited to 'platform/ios/src/MGLMapView.h')
-rw-r--r-- | platform/ios/src/MGLMapView.h | 104 |
1 files changed, 52 insertions, 52 deletions
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 |