summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLStyleValue.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLStyleValue.mm')
-rw-r--r--platform/darwin/src/MGLStyleValue.mm19
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyleValue.mm b/platform/darwin/src/MGLStyleValue.mm
index 4dd6b550d8..a16be09ba5 100644
--- a/platform/darwin/src/MGLStyleValue.mm
+++ b/platform/darwin/src/MGLStyleValue.mm
@@ -52,6 +52,10 @@ const MGLStyleFunctionOption MGLStyleFunctionOptionDefaultValue = @"MGLStyleFunc
return [self.rawValue debugDescription];
}
+- (id)debugQuickLookObject {
+ return self.rawValue;
+}
+
- (BOOL)isEqual:(MGLConstantStyleValue *)other {
return [other isKindOfClass:[self class]] && [other.rawValue isEqual:self.rawValue];
}
@@ -155,6 +159,21 @@ const MGLStyleFunctionOption MGLStyleFunctionOptionDefaultValue = @"MGLStyleFunc
self.interpolationBase];
}
+- (id)debugQuickLookObject {
+ UIBezierPath *path = [UIBezierPath bezierPath];
+ [path moveToPoint:CGPointMake(0, 0)];
+ [self.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomLevel, id _Nonnull obj, BOOL * _Nonnull stop) {
+ NSNumber *value = obj;
+ if (![value isKindOfClass:[NSNumber class]]) {
+ *stop = YES;
+ return;
+ }
+ [path addCurveToPoint:CGPointMake([zoomLevel doubleValue] * 20, [value doubleValue]) controlPoint1:CGPointMake(([zoomLevel doubleValue] - 0.7) * 20, [value doubleValue]) controlPoint2:CGPointMake(([zoomLevel doubleValue] - 0.3) * 20, [value doubleValue])];
+ }];
+ [path stroke];
+ return path;
+}
+
- (BOOL)isEqual:(MGLCameraStyleFunction *)other {
return ([other isKindOfClass:[self class]]
&& other.interpolationMode == self.interpolationMode