summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-07-28 10:16:20 -0700
committerMinh Nguyễn <mxn@1ec5.org>2017-07-28 10:16:20 -0700
commite0f99c0c1d6e45ab7b0525dd49fe6a698fc5aab8 (patch)
tree15e86548118826a682e70051947bc9028d11d616
parentcaba393c0ec3042a3e8e7f1a782e0283d131a996 (diff)
downloadqtlocation-mapboxgl-upstream/1ec5-quick-look.tar.gz
Experiments in looking quickly at style functionsupstream/1ec5-quick-look
-rw-r--r--platform/darwin/src/MGLStyleValue.mm19
-rw-r--r--platform/ios/app/MBXViewController.m3
2 files changed, 22 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
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index d3927374a7..9fea1820c4 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -1826,6 +1826,9 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
// that a device with an English-language locale is already effectively
// using locale-based country labels.
_usingLocaleBasedCountryLabels = [[self bestLanguageForUser] isEqualToString:@"en"];
+
+ MGLStyleLayer *layer = [style layerWithIdentifier:@"road-secondary-tertiary"];
+ NSLog(@"%@", layer);
}
- (void)mapViewRegionIsChanging:(MGLMapView *)mapView