diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-12-23 15:01:00 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-01-05 10:22:10 -0800 |
commit | b6f7d03e5d4cb632dd3c59e3c6451e33fadca945 (patch) | |
tree | c88f45d4f752ef4ce0db8275e19a51bd73861664 /platform/darwin/src/MGLStyle.mm | |
parent | 188a61af55d54a58740b77d572b442fc298bdb0f (diff) | |
download | qtlocation-mapboxgl-b6f7d03e5d4cb632dd3c59e3c6451e33fadca945.tar.gz |
[ios, macos] Sources, layers properties are immutable
If you need a mutable array of layers, use -mutableArrayValueForKey:.
Diffstat (limited to 'platform/darwin/src/MGLStyle.mm')
-rw-r--r-- | platform/darwin/src/MGLStyle.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index 10f4aabe19..959ba4e363 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -127,7 +127,7 @@ static NSURL *MGLStyleURL_emerald; #pragma mark Sources -- (NS_MUTABLE_SET_OF(MGLSource *) *)sources { +- (NS_SET_OF(MGLSource *) *)sources { auto rawSources = self.mapView.mbglMap->getSources(); NSMutableSet *sources = [NSMutableSet setWithCapacity:rawSources.size()]; for (auto rawSource = rawSources.begin(); rawSource != rawSources.end(); ++rawSource) { @@ -137,7 +137,7 @@ static NSURL *MGLStyleURL_emerald; return sources; } -- (void)setSources:(NS_MUTABLE_SET_OF(MGLSource *) *)sources { +- (void)setSources:(NS_SET_OF(MGLSource *) *)sources { for (MGLSource *source in self.sources) { [self removeSource:source]; } @@ -222,7 +222,7 @@ static NSURL *MGLStyleURL_emerald; #pragma mark Style layers -- (NS_MUTABLE_ARRAY_OF(MGLStyleLayer *) *)layers +- (NS_ARRAY_OF(MGLStyleLayer *) *)layers { auto layers = self.mapView.mbglMap->getLayers(); NSMutableArray *styleLayers = [NSMutableArray arrayWithCapacity:layers.size()]; @@ -233,7 +233,7 @@ static NSURL *MGLStyleURL_emerald; return styleLayers; } -- (void)setLayers:(NS_MUTABLE_ARRAY_OF(MGLStyleLayer *) *)layers { +- (void)setLayers:(NS_ARRAY_OF(MGLStyleLayer *) *)layers { for (MGLStyleLayer *layer in self.layers) { [self removeLayer:layer]; } |