From 9f4dd1c5f46ebc7915118d278f25b323c11c9b81 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Tue, 13 Dec 2016 10:09:54 -0800 Subject: [PATCH] [ios] Fix iosapp runtime styling examples (#7395) This fixes a few bugs in our iosapp examples that were exposed by recent refinements to the APIs they use. --- platform/ios/app/MBXViewController.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 9b3d003e23c..12b700049c8 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -733,7 +733,12 @@ - (void)styleRoadLayer { MGLLineStyleLayer *roadLayer = (MGLLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"road-primary"]; roadLayer.lineColor = [MGLStyleValue valueWithRawValue:[UIColor blackColor]]; - MGLStyleValue *lineWidthFunction = [MGLStyleValue valueWithStops:@{}]; + + MGLStyleValue *lineWidthFunction = [MGLStyleValue valueWithStops:@{ + @5: [MGLStyleValue valueWithRawValue:@5], + @10: [MGLStyleValue valueWithRawValue:@15], + @15: [MGLStyleValue valueWithRawValue:@30], + }]; MGLStyleValue *roadLineColor = [MGLStyleValue valueWithStops:@{ @10: [MGLStyleValue valueWithRawValue:[UIColor purpleColor]], @@ -1156,7 +1161,7 @@ - (void)styleRouteLine baseRouteLayer.lineJoin = [MGLStyleConstantValue valueWithRawValue:[NSValue valueWithMGLLineJoin:MGLLineJoinRound]]; [self.mapView.style addLayer:baseRouteLayer]; - MGLLineStyleLayer *routeLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"style-base-route-layer" source:routeSource]; + MGLLineStyleLayer *routeLayer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"style-route-layer" source:routeSource]; routeLayer.lineColor = [MGLStyleConstantValue valueWithRawValue:[UIColor whiteColor]]; routeLayer.lineWidth = [MGLStyleConstantValue valueWithRawValue:@15]; routeLayer.lineOpacity = [MGLStyleConstantValue valueWithRawValue:@0.8];