diff options
author | Josh Erb <josh.erb@mapbox.com> | 2018-10-30 18:03:56 -0400 |
---|---|---|
committer | Josh Erb <josh.erb@mapbox.com> | 2018-11-12 14:45:30 -0800 |
commit | 271b78c1309dd9391e9fc315e9d9873381f5999d (patch) | |
tree | 9c195e582180898f977eb7e4eb6a22a1178f4444 /platform/ios/src/MGLMapView.h | |
parent | a3945bf84004ece5116861266a73a60d67beebbe (diff) | |
download | qtlocation-mapboxgl-upstream/je-ios-example-links.tar.gz |
[ios][documentation] link API documentation to ios-sdk/examplesupstream/je-ios-example-links
Diffstat (limited to 'platform/ios/src/MGLMapView.h')
-rw-r--r-- | platform/ios/src/MGLMapView.h | 67 |
1 files changed, 65 insertions, 2 deletions
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 27394b61ff..0f8de86555 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -51,6 +51,9 @@ typedef NS_ENUM(NSUInteger, MGLAnnotationVerticalAlignment) { /** The mode used to track the user location on the map. Used with `MGLMapView.userTrackingMode`. + + #### Related examples + See the <a href="https://www.mapbox.com/ios-sdk/maps/examples/user-tracking-mode/">Switch between user tracking modes</a> example to learn how to toggle modes and how each mode behaves. */ typedef NS_ENUM(NSUInteger, MGLUserTrackingMode) { /** The map does not follow the user location. */ @@ -151,7 +154,10 @@ 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://www.mapbox.com/ios-sdk/maps/examples/simple-map-view/"> + Simple map view</a> example to learn how to initialize a basic `MGLMapView`. */ MGL_EXPORT IB_DESIGNABLE @interface MGLMapView : UIView @@ -177,6 +183,16 @@ 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://www.mapbox.com/ios-sdk/maps/examples/custom-style/"> + Apply a style designed in Mapbox Studio</a> example to learn how to + initialize an `MGLMapView` with a custom style. See the <a href="https://www.mapbox.com/ios-sdk/maps/examples/raster-styles/"> + Appy a style designed in Mapbox Studio Classic</a> example to learn how to + intialize an `MGLMapView` with a Studio Classic style _or_ a custom style + JSON. See the <a href="https://www.mapbox.com/ios-sdk/maps/examples/source-custom-vector/"> + Use third-party vector tiles</a> example to learn how to initialize an + `MGLMapView` with a third-party tile source. */ - (instancetype)initWithFrame:(CGRect)frame styleURL:(nullable NSURL *)styleURL; @@ -230,6 +246,11 @@ 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://www.mapbox.com/ios-sdk/maps/examples/switch-styles/"> + Switch between map styles</a> example to learn how to change the style of + a map at runtime. */ @property (nonatomic, null_resettable) NSURL *styleURL; @@ -398,6 +419,11 @@ 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://www.mapbox.com/ios-sdk/maps/examples/user-location-annotation/"> + Customize the user location annotation</a> to learn how to customize the + default user location annotation shown by `MGLUserTrackingMode`. */ @property (nonatomic, assign) MGLUserTrackingMode userTrackingMode; @@ -878,6 +904,11 @@ 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://www.mapbox.com/ios-sdk/maps/examples/camera-animation/"> + Camera animation</a> example to learn how to trigger an animation that + rotates around a central point. */ - (void)setCamera:(MGLMapCamera *)camera animated:(BOOL)animated; @@ -892,6 +923,11 @@ 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://www.mapbox.com/ios-sdk/maps/examples/camera-animation/"> + Camera animation</a> example to learn how to create a timed animation that + rotates around a central point for a specific duration. */ - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function; @@ -1115,6 +1151,11 @@ 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://www.mapbox.com/ios-sdk/maps/examples/point-conversion/"> + Point conversion</a> example to learn how to convert a `CGPoint` to a map + coordinate. */ - (CLLocationCoordinate2D)convertPoint:(CGPoint)point toCoordinateFromView:(nullable UIView *)view; @@ -1129,6 +1170,11 @@ 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://www.mapbox.com/ios-sdk/maps/examples/point-conversion/"> + Point conversion</a> example to learn how to convert a map coordinate to a + `CGPoint` object. */ - (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(nullable UIView *)view; @@ -1200,7 +1246,14 @@ 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. */ + annotation object. + + #### Related examples + See the <a href="https://www.mapbox.com/ios-sdk/maps/examples/annotation-models/"> + Annotation models</a> and <a href="https://www.mapbox.com/ios-sdk/maps/examples/line-geojson/"> + Add a line annotation from GeoJSON</a> examples to learn how to add an + annotation to an `MGLMapView` object. + */ - (void)addAnnotation:(id <MGLAnnotation>)annotation; /** @@ -1265,6 +1318,11 @@ 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://www.mapbox.com/ios-sdk/maps/examples/annotation-view-image/"> + Add annotation views and images</a> example learn how to most efficiently + reuse an `MGLAnnotationImage`. */ - (nullable __kindof MGLAnnotationImage *)dequeueReusableAnnotationImageWithIdentifier:(NSString *)identifier; @@ -1412,6 +1470,11 @@ 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://www.mapbox.com/ios-sdk/maps/examples/select-layer/"> + Select a feature within a layer</a> example to learn how to query an + `MGLMapView` object for visible `MGLFeature` objects. */ - (NSArray<id <MGLFeature>> *)visibleFeaturesAtPoint:(CGPoint)point NS_SWIFT_NAME(visibleFeatures(at:)); |