[ios, macos] Added URL accessor to MGLTileSource
This commit is contained in:
committed by
Minh Nguyễn
parent
117c8ed1d1
commit
224fe6b96f
@@ -95,6 +95,11 @@ static const CGFloat MGLRasterSourceRetinaTileSize = 512;
|
||||
super.rawSource = rawSource;
|
||||
}
|
||||
|
||||
- (NSURL *)configurationURL {
|
||||
auto url = self.rawSource->getURL();
|
||||
return url ? [NSURL URLWithString:@(url->c_str())] : nil;
|
||||
}
|
||||
|
||||
- (NSString *)attributionHTMLString {
|
||||
auto attribution = self.rawSource->getAttribution();
|
||||
return attribution ? @(attribution->c_str()) : nil;
|
||||
|
||||
@@ -162,6 +162,17 @@ typedef NS_ENUM(NSUInteger, MGLTileCoordinateSystem) {
|
||||
*/
|
||||
- (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NS_ARRAY_OF(NSString *) *)tileURLTemplates options:(nullable NS_DICTIONARY_OF(MGLTileSourceOption, id) *)options;
|
||||
|
||||
#pragma mark Accessing a Source’s Content
|
||||
|
||||
/**
|
||||
The URL to the TileJSON configuration file that specifies the contents of the
|
||||
source.
|
||||
|
||||
If the receiver was initialized using
|
||||
`-initWithIdentifier:tileURLTemplates:options`, this property is set to `nil`.
|
||||
*/
|
||||
@property (nonatomic, copy, nullable, readonly) NSURL *configurationURL;
|
||||
|
||||
#pragma mark Accessing Attribution Strings
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,12 @@ const MGLTileSourceOption MGLTileSourceOptionTileCoordinateSystem = @"MGLTileSou
|
||||
return [super initWithIdentifier:identifier];
|
||||
}
|
||||
|
||||
- (NSURL *)configurationURL {
|
||||
[NSException raise:@"MGLAbstractClassException"
|
||||
format:@"MGLTileSource is an abstract class"];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NS_ARRAY_OF(MGLAttributionInfo *) *)attributionInfos {
|
||||
return [self attributionInfosWithFontSize:0 linkColor:nil];
|
||||
}
|
||||
|
||||
@@ -69,6 +69,11 @@
|
||||
super.rawSource = rawSource;
|
||||
}
|
||||
|
||||
- (NSURL *)configurationURL {
|
||||
auto url = self.rawSource->getURL();
|
||||
return url ? [NSURL URLWithString:@(url->c_str())] : nil;
|
||||
}
|
||||
|
||||
- (NSString *)attributionHTMLString {
|
||||
auto attribution = self.rawSource->getAttribution();
|
||||
return attribution ? @(attribution->c_str()) : nil;
|
||||
|
||||
Reference in New Issue
Block a user