This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
[ios, macos] Take back source and layer ownership on removal - #7048
Merged
boundsj merged 1 commit intoNov 14, 2016
Merged
Conversation
|
@boundsj, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fabian-guerra, @frederoni and @1ec5 to be potential reviewers. |
boundsj
force-pushed
the
boundsj-darwin-return-source-layer-ownership
branch
from
November 14, 2016 17:11
aa8dac9 to
b2638b4
Compare
If a source or layer is removed from the style, recapture the unique pointer ownership. This makes it safe to add back sources and layers after they have been removed.
boundsj
force-pushed
the
boundsj-darwin-return-source-layer-ownership
branch
from
November 14, 2016 17:11
b2638b4 to
cd51255
Compare
Contributor
Author
|
Not that it is advisable, but this change makes it safe to write layer/source toggling logic that looks something like: // Assume you have pointers to "layer" and "source" instances that were previously added
if (toggleOff) {
[self.mapView.style removeLayer:layer];
[self.mapView.style removeSource:source];
} else {
[self.mapView.style addSource:source];
[self.mapView.style addLayer:layer];
} |
1ec5
approved these changes
Nov 14, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a source or layer is removed from the style, recapture the unique pointer ownership. This makes it safe to add back sources and layers after they have been removed.
Fixes iOS and macOS portion of #6959
cc @1ec5 @frederoni @incanus