-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] Implement circle-stroke properties #7356
Conversation
@jfirebaugh, thanks for your PR! By analyzing this pull request, we identified @mollymerp, @incanus and @1ec5 to be potential reviewers. |
Also includes stubs for fill-extrusion layer, because most of the code was auto-generated.
b8fbb3a
to
d747189
Compare
I went ahead and ran the SDK code generation as well. It depends on mapbox/mapbox-gl-style-spec#617. |
|
711cae3
to
d382460
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran the smoke tests locally, 🚢
@tobrun Can you see why the Android build is failing? [Edit: never mind, I think I figured it out.] |
d382460
to
fa95251
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There’s a bit more accounting to do in the iOS/macOS documentation comments, but for the most part this change looks good.
These changes don’t actually add support for 3D extrusions, do they? It’s going to be weird to have an MGLFillExtrusionStyleLayer type that’s effectively a no-op.
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleStrokeOpacity; | ||
|
||
/** | ||
The width of the circle's stroke. Strokes are placed outside of the "circle-radius". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After pulling in mapbox/mapbox-gl-style-spec#619, this will say circleRadius
like it’s supposed to.
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *fillExtrusionOpacity; | ||
|
||
/** | ||
Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We override any documentation that says “sprite” to say “style image” in platform/darwin/scripts/style-spec-overrides-v8.json while we await mapbox/mapbox-gl-style-spec#220.
@property (nonatomic, null_resettable) MGLStyleValue<NSString *> *fillExtrusionPattern; | ||
|
||
/** | ||
The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also use style-spec-overrides-v8.json to remove any sentence that talks about offsets or padding as arrays, because that isn’t how they’re represented in the SDK.
@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *fillExtrusionColor; | ||
#else | ||
/** | ||
The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fillExtrusionOpacity` to set layer opacity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per #6107 (comment), we override documentation to remove the phrase “as rgba
”, because this is CSS syntax, and alpha may be specified with -colorWithHue:saturation:brightness:alpha:
or -colorWithWhite:alpha:
instead of -colorWithRed:green:blue:alpha:
.
@property (nonatomic, null_resettable) MGLStyleValue<MGLColor *> *fillExtrusionColor; | ||
#else | ||
/** | ||
The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fillExtrusionOpacity` to set layer opacity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s kind of unfortunate that we’d be introducing references to light properties before actually adding that API to the SDK.
}; | ||
|
||
/** | ||
A fill-extrusion layer which allows customization of styling properties at runtime. You may |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to say “fill extrusion” instead of “fill-extrusion” here, but that can happen in a separate PR.
bd8543e
to
3bef308
Compare
3bef308
to
b474b7f
Compare
Ok, I manually reverted all the fill-extrusion additions. It's a booby trap for whoever next runs |
If it’s a problem, we could special-case |
Also includes stubs for fill-extrusion layer, because most of the code was auto-generated.
Submitting this ahead of the data-driven styling PR because the DDS PR also requires updating the style-spec and regenerating the style code, and these changes would otherwise come along for the ride there.
I didn't run the SDK code generation. Since this is strictly additions, I'm hopeful they'll compile nevertheless. Adding SDK bindings for circle-stroke properties can then be done in a separate step.
Fixes #7231.