diff options
Diffstat (limited to 'platform/darwin/src/MGLRasterSource.mm')
-rw-r--r-- | platform/darwin/src/MGLRasterSource.mm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLRasterSource.mm b/platform/darwin/src/MGLRasterSource.mm index 62472050e3..1671e1decd 100644 --- a/platform/darwin/src/MGLRasterSource.mm +++ b/platform/darwin/src/MGLRasterSource.mm @@ -1,4 +1,4 @@ -#import "MGLRasterSource.h" +#import "MGLRasterSource_Private.h" #import "MGLMapView_Private.h" #import "MGLSource_Private.h" @@ -9,6 +9,8 @@ @interface MGLRasterSource () +- (instancetype)initWithRawSource:(mbgl::style::RasterSource *)rawSource NS_DESIGNATED_INITIALIZER; + @property (nonatomic) mbgl::style::RasterSource *rawSource; @end @@ -39,6 +41,16 @@ return self; } +- (instancetype)initWithRawSource:(mbgl::style::RasterSource *)rawSource { + if (self = [super initWithRawSource:rawSource]) { + if (auto attribution = rawSource->getAttribution()) { + _tileSet = [[MGLTileSet alloc] initWithTileURLTemplates:@[]]; + _tileSet.attribution = @(attribution->c_str()); + } + } + return self; +} + - (void)commonInit { std::unique_ptr<mbgl::style::RasterSource> source; |