diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-04-21 13:35:34 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-22 08:04:39 -0700 |
commit | 1520a56813f82bbe875774fdc2b3df26392278d6 (patch) | |
tree | d8f6ccc10e118bd2be6a954951c037f9c2fc1384 /platform/darwin/src/MGLStyleLayer.mm | |
parent | be7e9bbb8d54c775127f53d793c117c4bf5e2764 (diff) | |
download | qtlocation-mapboxgl-1520a56813f82bbe875774fdc2b3df26392278d6.tar.gz |
[all] Promote Style to public API
Diffstat (limited to 'platform/darwin/src/MGLStyleLayer.mm')
-rw-r--r-- | platform/darwin/src/MGLStyleLayer.mm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/platform/darwin/src/MGLStyleLayer.mm b/platform/darwin/src/MGLStyleLayer.mm index 4bfaea934b..6400b8fcbf 100644 --- a/platform/darwin/src/MGLStyleLayer.mm +++ b/platform/darwin/src/MGLStyleLayer.mm @@ -1,7 +1,7 @@ #import "MGLStyleLayer_Private.h" -#import "MGLMapView_Private.h" +#import "MGLStyle_Private.h" -#include <mbgl/map/map.hpp> +#include <mbgl/style/style.hpp> #include <mbgl/style/layer.hpp> @interface MGLStyleLayer () @@ -30,26 +30,26 @@ return self; } -- (void)addToMapView:(MGLMapView *)mapView belowLayer:(MGLStyleLayer *)otherLayer +- (void)addToStyle:(MGLStyle *)style belowLayer:(MGLStyleLayer *)otherLayer { if (_pendingLayer == nullptr) { [NSException raise:@"MGLRedundantLayerException" format:@"This instance %@ was already added to %@. Adding the same layer instance " \ - "to the style more than once is invalid.", self, mapView.style]; + "to the style more than once is invalid.", self, style]; } if (otherLayer) { const mbgl::optional<std::string> belowLayerId{otherLayer.identifier.UTF8String}; - mapView.mbglMap->addLayer(std::move(_pendingLayer), belowLayerId); + style.rawStyle->addLayer(std::move(_pendingLayer), belowLayerId); } else { - mapView.mbglMap->addLayer(std::move(_pendingLayer)); + style.rawStyle->addLayer(std::move(_pendingLayer)); } } -- (void)removeFromMapView:(MGLMapView *)mapView +- (void)removeFromStyle:(MGLStyle *)style { - if (self.rawLayer == mapView.mbglMap->getLayer(self.identifier.UTF8String)) { - _pendingLayer = mapView.mbglMap->removeLayer(self.identifier.UTF8String); + if (self.rawLayer == style.rawStyle->getLayer(self.identifier.UTF8String)) { + _pendingLayer = style.rawStyle->removeLayer(self.identifier.UTF8String); } } |