-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update style spec for sky properties #10272
Conversation
src/style-spec/reference/v8.json
Outdated
@@ -6016,6 +6019,9 @@ | |||
0 | |||
], | |||
"length": 2, | |||
"units": "degrees", | |||
"minimum": 0, | |||
"maximum": 90, |
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.
Realizing that polar ranges 0-90 but azimuthal doesn't have the same constraint. Is there a way to specify the min/max of each number in the array, or would it be better to remove this altogether?
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.
The altitude ranges in [0,180] (0 at top/zenith, 180 below) while the azimuth in [0,360] (0 north and increasing clock-wise). I don't think our spec allows to untie these to only accept a range for one of the value but not the other, but I might be wrong. This spec is matching to the light "position" spec, which does not have min and max.
Unless we can assign separate values I'm in favor of removing.
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.
@thefifthisa did you have a path forward for this? We could add validation of multiple min/max values here https://github.com/mapbox/mapbox-gl-js/blob/main/src/style-spec/validate/validate_number.js#L20, if not done in this PR, we can remove these values for the time being and address support for that separately (Otherwise we'd be constraining with an incorrect range).
@karimnaaji thanks and sorry I missed this earlier! I've updated the spec and validation to accept an array for Looks like some integration tests are timing out though, starting from 14c511a. Did I miss something here? |
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.
This looks good to me! Thanks for the change @thefifthisa
I'm re-running the render tests as it seems that none failed but still reported a failed result, should be passing in a few. |
The render test is actually failing on line-dasharray/unusual-cases/negative-values. I think there's something that breaks this test introduced in this PR. The test is timed out because it does not finish and gets stuck. |
fde8bfd
to
4d76ba4
Compare
The failure in the render test was not being reported appropriately, but it was a useful issue that you fixed with this PR. We were not correctly validating dash arrays such as [1, -2, -1, 1] until now, where only the first value was accounted for the bounds. The render test line-dasharray/unusual-cases/negative-values was using such values and the spec of dasharray has a limit of a minimum of 0, which wasn't correctly validated until your change; it was only checking that range for the very first value. I've removed that test and replaced it with a unit test, and also split the validation file in their own separate files. This change will need to be ported to native, cc @mapbox/gl-native . |
Thanks @karimnaaji! |
This PR updates
sky-gradient-center
andsky-atmosphere-sun
with the appropriate units. Also see inline comment about min/max values.Closes #10269
Closes #10270
cc @samanpwbb
Launch Checklist
@mapbox/map-design-team
@mapbox/static-apis
if this PR includes style spec API or visual changes@mapbox/gl-native
if this PR includes shader changes or needs a native portmapbox-gl-js
changelog:<changelog></changelog>