You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Historic, Railway, Woodblock, and Japanese Scroll styles are all currently using the filter, function, and token syntaxes, which were deprecated in 2017 in favor of expressions. Expressions are required for many newer GL JS features that we’ll need to implement features such as language fallbacks and bilingual labels for #481. Expressions will also help us consolidate style layers, which will allow the tiler to consolidate the tileset’s layers as well, improving performance across the board.
A stylesheet can contain a mix of functions and expressions, but it’s a lot cleaner and less error-prone to migrate everything over to expressions at once. It looks like Maputnik has rudimentary, nonvisual support for editing expressions and converting functions to expressions: maplibre/maputnik#620maplibre/maputnik#622. If we need a more visual expression editor, Fresco is one alternative. It uses Mapbox GL JS under the hood rather than MapLibre GL JS, though it would be possible to avoid incompatibilities by testing before deployment.
Once this is complete, we’ll need to update all the time slider implementations to manipulate a filter based on an expression instead of a legacy function, as outlined in gramps-project/gramps-web#454 (comment). This would be a good opportunity to factor out a plugin for date filtering: #840.
at our carto meeting, @vknoppkewetzel indicated this work is complete & @1ec5 reminded us that this should break the timeslider, which uses the older filters.
So, it seems like the completion of this ticket bumps up the priority of this fix: #855 - updating timeslider to supporting expressions
As well as the priority of these tickets supporting new features: #679 - All name keys in vtiles #854 - Providing the right name strings to the stylesheets for localization
In addition, we should identify other possible performance improvements enabled by the expressions upgrade:
Additionally, as far as I can tell, no filter has been converted to use expressions yet. (It’s the conversion of filters that would need to be coordinated with a fix for #855.)
Once all this work is complete, we can track combining style layers for better performance as a separate task.
Activity
erictheise commentedon May 1, 2024
I've got a fair amount of experience coding/converting style expressions manually so keep me in mind as a resource on this issue.
Draft conversion to expressions
jeffreyameyer commentedon May 29, 2024
Any update or progress on this ticket? I'm feeling like we're getting closer to some multilingual labels (#481).
danrademacher commentedon Jun 11, 2024
@erictheise could take a look at this commit OpenHistoricalMap/map-styles@2cfb70c and make any recommendations for next steps.
danrademacher commentedon Jun 12, 2024
Looking at dependencies for #481, which is our priority here, @tsinn also needs to convert the text labels to expressions
jeffreyameyer commentedon Jun 25, 2024
Is there any sort of eta for this being completed, or how much progress has been made so far?
1ec5 commentedon Jul 7, 2024
Once this is complete, we’ll need to update all the time slider implementations to manipulate a filter based on an expression instead of a legacy function, as outlined in gramps-project/gramps-web#454 (comment). This would be a good opportunity to factor out a plugin for date filtering: #840.
2 remaining items
Continued converting functions to expressions
vknoppkewetzel commentedon Jul 25, 2024
Updating this ticket - Last week, Tim wrapped up converting all functions to expressions
jeffreyameyer commentedon Jul 25, 2024
at our carto meeting, @vknoppkewetzel indicated this work is complete & @1ec5 reminded us that this should break the timeslider, which uses the older filters.
So, it seems like the completion of this ticket bumps up the priority of this fix:
#855 - updating timeslider to supporting expressions
As well as the priority of these tickets supporting new features:
#679 - All name keys in vtiles
#854 - Providing the right name strings to the stylesheets for localization
In addition, we should identify other possible performance improvements enabled by the expressions upgrade:
etc.
1ec5 commentedon Aug 4, 2024
This work is not complete. As of OpenHistoricalMap/map-styles@1179bee, the style functions have been converted to expressions. However, every
text-fieldproperty is still set to a string with the deprecated{token}syntax instead of agetexpression. This blocks label localization.Additionally, as far as I can tell, no filter has been converted to use expressions yet. (It’s the conversion of filters that would need to be coordinated with a fix for #855.)
Once all this work is complete, we can track combining style layers for better performance as a separate task.
vknoppkewetzel commentedon Aug 5, 2024
Thanks @1ec5 we will take a look at this and resolve those, thanks for catching
text-field from strings to expressions
Filters to expressions
1ec5 commentedon Nov 13, 2024
MapLibre publishes a command line tool,
gl-style-migrate, that automatically converts legacy filters, functions, and tokens to expressions.vknoppkewetzel commentedon Nov 21, 2024
🎉