diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-01-16 11:38:35 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-01-16 11:38:35 -0800 |
commit | 7ef2843e6a62116667be6a2c12de085951fdd5ea (patch) | |
tree | 40eca249e044e2706efd1193d617e6eb8e59d708 /platform/darwin/src/MGLStyle.h | |
parent | 76301b252cbc4bc3ae1fc84322bcbcdbd26cae8a (diff) | |
parent | 13b97dd0cebffe36b187bdb74923910def6bd87b (diff) | |
download | qtlocation-mapboxgl-7ef2843e6a62116667be6a2c12de085951fdd5ea.tar.gz |
Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.7
Diffstat (limited to 'platform/darwin/src/MGLStyle.h')
-rw-r--r-- | platform/darwin/src/MGLStyle.h | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/platform/darwin/src/MGLStyle.h b/platform/darwin/src/MGLStyle.h index 6192632e75..9bd35142c2 100644 --- a/platform/darwin/src/MGLStyle.h +++ b/platform/darwin/src/MGLStyle.h @@ -41,10 +41,10 @@ static MGL_EXPORT const NSInteger MGLStyleDefaultVersion = 9; via `-[MGLMapView style]` by updating the style's data sources or layers. @note Wait until the map style has finished loading before modifying a map's - style via any of the MGLStyle instance methods below. - You can use the `MGLMapViewDelegate` methods `-mapViewDidFinishLoadingMap:` - or `-mapView:didFinishLoadingStyle:` as indicators that it's safe - to modify the map's style. + style via any of the `MGLStyle` instance methods below. You can use the + `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or + `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` methods as indicators + that it's safe to modify the map's style. */ MGL_EXPORT @interface MGLStyle : NSObject @@ -191,7 +191,7 @@ MGL_EXPORT /** A set containing the style’s sources. */ -@property (nonatomic, strong) NS_MUTABLE_SET_OF(MGLSource *) *sources; +@property (nonatomic, strong) NS_SET_OF(__kindof MGLSource *) *sources; /** Returns a source with the given identifier in the current style. @@ -215,8 +215,13 @@ MGL_EXPORT @note Adding the same source instance more than once will result in a `MGLRedundantSourceException`. Reusing the same source identifier, even with different source instances, will result in a - `MGLRedundantSourceIdentifierException`. + `MGLRedundantSourceIdentifierException`. + @note Sources should be added in + `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or + `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map + has loaded the style and is ready to accept a new source. + @param source The source to add to the current style. */ - (void)addSource:(MGLSource *)source; @@ -239,10 +244,10 @@ MGL_EXPORT #pragma mark Managing Style Layers /** - The layers included in the style, arranged according to their front-to-back + The layers included in the style, arranged according to their back-to-front ordering on the screen. */ -@property (nonatomic, strong) NS_MUTABLE_ARRAY_OF(MGLStyleLayer *) *layers; +@property (nonatomic, strong) NS_ARRAY_OF(__kindof MGLStyleLayer *) *layers; /** Returns a style layer with the given identifier in the current style. @@ -266,7 +271,12 @@ MGL_EXPORT @note Adding the same layer instance more than once will result in a `MGLRedundantLayerException`. 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 + `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or + `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map + 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 instance of a concrete subclass of `MGLStyleLayer`. @@ -278,7 +288,12 @@ MGL_EXPORT @note Adding the same layer instance more than once will result in a `MGLRedundantLayerException`. 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 + `-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]` or + `-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]` to ensure that the map + has loaded the style and is ready to accept a new layer. @param layer The layer to insert. @param index The index at which to insert the layer. An index of 0 would send |