-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add ZoomConstantExpression to StylePropertyExpression #267
Comments
I think 1 is better, but we need to understand why it wasn't like that to begin with, i.e. is adding it to the type generalise it too much or is incorrect in some places... |
agreed for sure. I will do some investigation, hoping that we will get some input from @birkskyum or someone else who knows. |
I don't know this area of the library well unfortunately. |
Looking at this some more, I don't know if adding Rather than just adding the zoom expressions to the For now, I think we should just expose an |
Fixed by #334 |
Describe the bug
In this piece of code from maplibre-gl-gs:
we are coercing
expression
toZoomConstantExpression<'source'>
. This is required becauseexpression
is defined as aStylePropertyExpression = ConstantExpression | SourceExpression | CameraExpression | CompositeExpression
.This coercion tells me that there's some problem with the typing here. I see two options:
StylePropertyExpression
to includeZoomConstantExpression
, and possiblyZoomDependentExpression
as well. Currently, these are the only two expression types thatStylePropertyExpression
doesn't include.mapbox-gl-gs
codebase, setexpression: StylePropertyExpression | ZoomConstantExpression<'source'>
I'd think option 1 is better, but I'm very familiar with the types here. @birkskyum do you have an opinion?
This issue came up when investigating maplibre/maplibre-gl-js#2837
The text was updated successfully, but these errors were encountered: