-
-
Notifications
You must be signed in to change notification settings - Fork 91
global-state expression #1044
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
global-state expression #1044
Conversation
…to NAV-171460-global-state-expression
Looks good! Thanks! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1044 +/- ##
==========================================
- Coverage 93.67% 93.66% -0.01%
==========================================
Files 112 115 +3
Lines 4888 4928 +40
Branches 1392 1401 +9
==========================================
+ Hits 4579 4616 +37
- Misses 309 312 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…m-forks/maplibre-style-spec into NAV-171460-global-state-expression
@HarelM @louwers Please take another look 😉 As discussed on the call:
PR description and the changelog were updated to reflect the changes. |
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.
LGTM, THANKS!
I think the last comment that was not addressed is the following: |
@HarelM updated native issue: maplibre/maplibre-native#3302 |
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.
Please see my comments for suggestions on slightly rewording the documentation for clarity.
Otherwise LGTM.
@zbigniewmatysek-tomtom Incredible work! Much appreciated how you move the proposal from maplibre/maplibre-gl-js#4964 forward! |
@zbigniewmatysek-tomtom can you please address the last few comments, so I'll be able to release a new version of the style-spec package? |
Co-authored-by: Bart Louwers <[email protected]>
Co-authored-by: Bart Louwers <[email protected]>
…-spec into NAV-171460-global-state-expression
@louwers @HarelM |
@louwers feel free to push the merge button once you finish the review. |
See https://github.com/maplibre/maplibre-gl-js/releases/tag/v5.6.0 This includes maplibre/maplibre-gl-js#5613 allowing for global map state (like theme and date). Uses maplibre/maplibre-style-spec#1044, maplibre/maplibre-style-spec#886, maplibre/maplibre-gl-js#4964.
See https://github.com/maplibre/maplibre-gl-js/releases/tag/v5.6.0 This includes maplibre/maplibre-gl-js#5613 allowing for global map state (like theme and date). Uses maplibre/maplibre-style-spec#1044, maplibre/maplibre-style-spec#886, maplibre/maplibre-gl-js#4964. Changes: replace `date` with a global state property, to simplify map rendering and dynamic date changes.
maplibre/maplibre-style-spec#1044 - new expression `global-state` that retrieves a property value from the new root property state https://maplibre.org/maplibre-style-spec/expressions/#global-state - new root property `state` , where the default value can be set https://maplibre.org/maplibre-style-spec/root/#state
maplibre/maplibre-style-spec#1044 - new expression `global-state` that retrieves a property value from the new root property state https://maplibre.org/maplibre-style-spec/expressions/#global-state - new root property `state`, where the default value can be set https://maplibre.org/maplibre-style-spec/root/#state
maplibre/maplibre-style-spec#1044 - new expression `global-state` that retrieves a property value from the new root property state https://maplibre.org/maplibre-style-spec/expressions/#global-state - new root property `state`, where the default value can be set https://maplibre.org/maplibre-style-spec/root/#state
This PR introduces:
global-state
that retrieves a property value from the new root propertystate
.state
, where the default value can be set. This eliminates need to putcoalesce
in all places whereglobal-state
is used.The expression is similar to
get
and such be interpreted by renderers as such:null
global-state
inliteral
if it returns an array.Renderer implementations can expose methods such as setGlobalStateProperty(name, value) for changing the state properties at runtime.
Use cases enabled or simplified by this extension:
Related issues:
#886
maplibre/maplibre-gl-js#4964
Launch Checklist
CHANGELOG.md
under the## main
section.