diff options
author | danswick <dan.swick@gmail.com> | 2019-09-18 11:39:43 -0700 |
---|---|---|
committer | danswick <dan.swick@gmail.com> | 2019-09-18 11:39:43 -0700 |
commit | 46914ecff8b3f2a1945b33358a879c2aac074f17 (patch) | |
tree | 697cf276a43ae4c18c0ad7029c00e7d771448822 /platform/darwin/src/MGLRasterTileSource.mm | |
parent | 47ea84ad1a5fed3431d026c5765c17c507d4623e (diff) | |
parent | 8805defe57aa0d8886c7828d39b1b9b1f17f21b8 (diff) | |
download | qtlocation-mapboxgl-upstream/android-docs-automation.tar.gz |
Merge branch 'master' into android-docs-automationupstream/android-docs-automation
Diffstat (limited to 'platform/darwin/src/MGLRasterTileSource.mm')
-rw-r--r-- | platform/darwin/src/MGLRasterTileSource.mm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/platform/darwin/src/MGLRasterTileSource.mm b/platform/darwin/src/MGLRasterTileSource.mm index e89367711e..b31cee296f 100644 --- a/platform/darwin/src/MGLRasterTileSource.mm +++ b/platform/darwin/src/MGLRasterTileSource.mm @@ -33,15 +33,16 @@ static const CGFloat MGLRasterTileSourceRetinaTileSize = 512; } - (instancetype)initWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL tileSize:(CGFloat)tileSize { - auto source = [self pendingSourceWithIdentifier:identifier configurationURL:configurationURL tileSize:tileSize]; + NSString *configurationURLString = configurationURL.mgl_URLByStandardizingScheme.absoluteString; + auto source = [self pendingSourceWithIdentifier:identifier urlOrTileset:configurationURLString.UTF8String tileSize:uint16_t(round(tileSize))]; return self = [super initWithPendingSource:std::move(source)]; } -- (std::unique_ptr<mbgl::style::RasterSource>)pendingSourceWithIdentifier:(NSString *)identifier configurationURL:(NSURL *)configurationURL tileSize:(CGFloat)tileSize { - NSString *configurationURLString = configurationURL.mgl_URLByStandardizingScheme.absoluteString; - return std::make_unique<mbgl::style::RasterSource>(identifier.UTF8String, - configurationURLString.UTF8String, - uint16_t(round(tileSize))); +- (std::unique_ptr<mbgl::style::RasterSource>)pendingSourceWithIdentifier:(NSString *)identifier urlOrTileset:(mbgl::variant<std::string, mbgl::Tileset>)urlOrTileset tileSize:(uint16_t)tileSize { + auto source = std::make_unique<mbgl::style::RasterSource>(identifier.UTF8String, + urlOrTileset, + tileSize); + return source; } - (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray<NSString *> *)tileURLTemplates options:(nullable NSDictionary<MGLTileSourceOption, id> *)options { @@ -56,7 +57,7 @@ static const CGFloat MGLRasterTileSourceRetinaTileSize = 512; tileSize = static_cast<uint16_t>(round(tileSizeNumber.doubleValue)); } - auto source = std::make_unique<mbgl::style::RasterSource>(identifier.UTF8String, tileSet, tileSize); + auto source = [self pendingSourceWithIdentifier:identifier urlOrTileset:tileSet tileSize:tileSize]; return self = [super initWithPendingSource:std::move(source)]; } |