-
Notifications
You must be signed in to change notification settings - Fork 2
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
Publish GL JS plugin for time filtering #840
Comments
For any style layer that’s already written as an expression, we should probably use the The existing implementations all key off the decimal date fields because MapLibre’s legacy filter syntax can only compare strings verbatim. With expressions, we can parse the strings and compare them lexicographically. This not only avoids any floating point precision error but also potentially opens the door to intraday filtering, once the tiles expose the contents of |
I started maplibre-gl-dates by extracting the relevant bits of OpenHistoricalMap/openhistoricalmap-embed@e3a45aa.
|
The maplibre-gl-dates plugin should be in decent shape now. I’ve deployed it to all the sites mentioned above, except for Gramps Web, which is awaiting review: gramps-project/gramps-web#479. Meanwhile, #855 tracks upgrading leaflet-ohm-timeslider-v2. Any remaining work on the plugin or its adoption can be tracked in separate tickets. |
The timeslider library is fine if you already have a Leaflet map set up and want a full-blown UI, but a developer might be using a Mapbox/MapLibre GL JS map directly or they might only need the filtering capability without an interactive slider UI. Perhaps they want to supply their own UI with a distinctive design, or they only want to show a particular date noninteractively.
We should publish an NPM library that only contains the runtime styling code for manipulating the stylesheet’s filters using runtime styling. There are already many reimplentations of this code that could benefit from consolidation, such as:
None of these implementations follows the Leaflet timeslider plugin’s date filtering implementation, which is too complicated to use as an example: #562.
For #651, we’ll need to reimplement the timeslider to eliminate its Leaflet dependency. This would be a good opportunity to have the Leaflet timeslider plugin depend on a consolidated library.
As soon as we convert the stylesheets to use expressions (#775), we’ll need to update each of these implementations to manipulate expressions instead of legacy function-based filters, as outlined in gramps-project/gramps-web#454 (comment). We might as well migrate them to this new library at the same time. The library could support either syntax for broad compatibility.
The text was updated successfully, but these errors were encountered: