summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLStyle.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLStyle.mm')
-rw-r--r--platform/darwin/src/MGLStyle.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm
index cd9c4465b5..f1c3e68e3a 100644
--- a/platform/darwin/src/MGLStyle.mm
+++ b/platform/darwin/src/MGLStyle.mm
@@ -34,6 +34,7 @@
@interface MGLStyle()
@property (nonatomic, weak) MGLMapView *mapView;
+@property (readonly, copy, nullable) NSURL *URL;
@end
@implementation MGLStyle
@@ -92,6 +93,10 @@ static NSURL *MGLStyleURL_emerald;
return @(self.mapView.mbglMap->getStyleName().c_str());
}
+- (NSURL *)URL {
+ return [NSURL URLWithString:@(self.mapView.mbglMap->getStyleURL().c_str())];
+}
+
- (MGLStyleLayer *)layerWithIdentifier:(NSString *)identifier
{
auto mbglLayer = self.mapView.mbglMap->getLayer(identifier.UTF8String);
@@ -254,5 +259,12 @@ static NSURL *MGLStyleURL_emerald;
}
}
+- (NSString *)description
+{
+ return [NSString stringWithFormat:@"<%@: %p; name = %@, URL = %@>",
+ NSStringFromClass([self class]), (void *)self,
+ self.name ? [NSString stringWithFormat:@"\"%@\"", self.name] : self.name,
+ self.URL ? [NSString stringWithFormat:@"\"%@\"", self.URL] : self.URL];
+}
@end