Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios] Fix iosapp runtime styling examples (#7395)
Browse files Browse the repository at this point in the history
This fixes a few bugs in our iosapp examples that were exposed by
recent refinements to the APIs they use.
  • Loading branch information
boundsj authored Dec 13, 2016
1 parent d3895b4 commit 9f4dd1c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions platform/ios/app/MBXViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,12 @@ - (void)styleRoadLayer
{
MGLLineStyleLayer *roadLayer = (MGLLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"road-primary"];
roadLayer.lineColor = [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor blackColor]];
MGLStyleValue *lineWidthFunction = [MGLStyleValue<NSNumber *> valueWithStops:@{}];

MGLStyleValue *lineWidthFunction = [MGLStyleValue<NSNumber *> valueWithStops:@{
@5: [MGLStyleValue<NSNumber *> valueWithRawValue:@5],
@10: [MGLStyleValue<NSNumber *> valueWithRawValue:@15],
@15: [MGLStyleValue<NSNumber *> valueWithRawValue:@30],
}];

MGLStyleValue *roadLineColor = [MGLStyleValue<UIColor *> valueWithStops:@{
@10: [MGLStyleValue<UIColor *> valueWithRawValue:[UIColor purpleColor]],
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 9f4dd1c

Please sign in to comment.