diff options
author | Julian Rex <julian.rex@gmail.com> | 2018-11-20 10:26:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-20 10:26:09 -0500 |
commit | 90f609ca8fe92f89374a7c1438511cde0f72195a (patch) | |
tree | 575483facd4204f0da290a5c37da620107737f18 /platform/darwin/src/MGLStyle.h | |
parent | 9ac444a08d9701dc7b0da41859842a77d7be8e00 (diff) | |
download | qtlocation-mapboxgl-90f609ca8fe92f89374a7c1438511cde0f72195a.tar.gz |
[ios, macos] Added `-(BOOL)[MGLStyle removeSource:error:]` that provides an NSError. (#13399)
Diffstat (limited to 'platform/darwin/src/MGLStyle.h')
-rw-r--r-- | platform/darwin/src/MGLStyle.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyle.h b/platform/darwin/src/MGLStyle.h index fcbd318b18..7621db0ad5 100644 --- a/platform/darwin/src/MGLStyle.h +++ b/platform/darwin/src/MGLStyle.h @@ -318,6 +318,27 @@ MGL_EXPORT */ - (void)removeSource:(MGLSource *)source; +/** + Removes a source from the current style. + + @note Source 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 like + `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + inspectable in Interface Builder, or a manually constructed `NSURL`. This + approach also avoids source identifer name changes that will occur in the default + style’s sources over time. + + @param source The source to remove from the current style. + @param outError Upon return, if an error has occurred, a pointer to an `NSError` + object describing the error. Pass in `NULL` to ignore any error. + + @return `YES` if `source` was removed successfully. If `NO`, `outError` contains + an `NSError` object describing the problem. + */ +- (BOOL)removeSource:(MGLSource *)source error:(NSError * __nullable * __nullable)outError; + + #pragma mark Managing Style Layers /** |