diff options
Diffstat (limited to 'platform/darwin/src/MGLSource.mm')
-rw-r--r-- | platform/darwin/src/MGLSource.mm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/platform/darwin/src/MGLSource.mm b/platform/darwin/src/MGLSource.mm index 7bab90e9de..6d57e14e8c 100644 --- a/platform/darwin/src/MGLSource.mm +++ b/platform/darwin/src/MGLSource.mm @@ -1,6 +1,8 @@ #import "MGLSource_Private.h" +#import "MGLStyle_Private.h" #import "MGLMapView_Private.h" +#include <mbgl/style/style.hpp> #include <mbgl/map/map.hpp> #include <mbgl/style/source.hpp> @@ -48,16 +50,16 @@ if (_pendingSource == nullptr) { [NSException raise:@"MGLRedundantSourceException" format:@"This instance %@ was already added to %@. Adding the same source instance " \ - "to the style more than once is invalid.", self, mapView.style]; + "to the style more than once is invalid.", self, mapView.style]; } - + _mapView = mapView; - mapView.mbglMap->addSource(std::move(_pendingSource)); + _mapView.style.rawStyle->addSource(std::move(_pendingSource)); } - (void)removeFromMapView:(MGLMapView *)mapView { - if (self.rawSource == mapView.mbglMap->getSource(self.identifier.UTF8String)) { - _pendingSource = mapView.mbglMap->removeSource(self.identifier.UTF8String); + if (self.rawSource == mapView.style.rawStyle->getSource(self.identifier.UTF8String)) { + _pendingSource = mapView.style.rawStyle->removeSource(self.identifier.UTF8String); _mapView = nil; } } |