diff options
Diffstat (limited to 'platform/darwin/src/MGLSource_Private.h')
-rw-r--r-- | platform/darwin/src/MGLSource_Private.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/platform/darwin/src/MGLSource_Private.h b/platform/darwin/src/MGLSource_Private.h index ba78973279..d7d1f66641 100644 --- a/platform/darwin/src/MGLSource_Private.h +++ b/platform/darwin/src/MGLSource_Private.h @@ -18,7 +18,7 @@ struct SourceWrapper { __weak MGLSource *source; }; -@class MGLStyle; +@class MGLMapView; @interface MGLSource (Private) @@ -26,7 +26,7 @@ struct SourceWrapper { Initializes and returns a source with a raw pointer to the backing store, associated with a style. */ -- (instancetype)initWithRawSource:(mbgl::style::Source *)rawSource; +- (instancetype)initWithRawSource:(mbgl::style::Source *)rawSource mapView:(nullable MGLMapView *)mapView; /** Initializes and returns a source with an owning pointer to the backing store, @@ -44,33 +44,30 @@ struct SourceWrapper { @property (nonatomic, readonly) mbgl::style::Source *rawSource; /** - The style which currently contains the source. - - If the source is not currently part of a style, this property is + The map view whose style currently contains the source. + If the source is not currently part of any map view’s style, this property is set to `nil`. */ -@property (nonatomic, readonly, weak) MGLStyle *style; +@property (nonatomic, readonly, weak) MGLMapView *mapView; /** - Adds the mbgl source that this object represents to the style. - + Adds the mbgl source that this object represents to the mbgl map. Once a mbgl source is added, ownership of the object is transferred to the - `mbgl::Style` 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 can still be changed but the changes will not be visible until the `MGLSource` - is added back to the style via `-[MGLStyle addSource:]` and styled with a + is added back to the map via `-[MGLStyle addSource:]` and styled with a `MGLLayer`. */ -- (void)addToStyle:(MGLStyle *)style; +- (void)addToMapView:(MGLMapView *)mapView; /** - Removes the mbgl source that this object represents from the style. - + 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 to the `MGLSource` instance and the unique_ptr reference is valid again. It is safe to add the source back to the style after it is removed. */ -- (void)removeFromStyle:(MGLStyle *)style; +- (void)removeFromMapView:(MGLMapView *)mapView; @end |