Skip to content
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

docs: hillshade-illumination-direction is documented as a closed range [0,359] but should actually be a half open range [0,360) #939

Open
sargunv opened this issue Dec 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sargunv
Copy link

sargunv commented Dec 13, 2024

Describe the bug

(unsure if misleading documentation counts as a "bug" but it seems fitting)

The hillshade-illumination-direction property is documented as a closed range [0,359] but should actually be a half open range [0,360), because it's a floating point value; 359.5 is a valid value. I saw this while working on maplibre-compose and assumed it only accepts integer degrees, only to check the source code and realize it accepts floats.

Looking at the JSON style spec, I don't think it supports a way to define a half open range with a real number maximum, so it's not actually a trivial fix to the docs.

"hillshade-illumination-direction": {
"type": "number",
"default": 335,
"minimum": 0,
"maximum": 359,
"doc": "The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",
"transition": false,
"sdk-support": {
"basic functionality": {
"js": "0.43.0",
"android": "6.0.0",
"ios": "4.0.0"
}
},
"expression": {
"interpolated": true,
"parameters": [
"zoom"
]
},
"property-type": "data-constant"
},

@sargunv sargunv added the bug Something isn't working label Dec 13, 2024
@HarelM
Copy link
Collaborator

HarelM commented Dec 13, 2024

Yup, the docs are generated from the v8 file, and the v8 content syntax is not great.
Feel free to try and heck it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants