Skip to content

How can we time-enable Maputnik? #529

Open

Description

@danrademacher

During a discussion of cartography, I noted that "real-time" collaborative styling in Maputnik has limitations since there's no timeslider there and you see all data at once. The view is similar to this slider-less demo: https://openhistoricalmap.github.io/map-styles/demo.html
image

So it takes some practice and imagination -- and cycling through a locally running timeslider demo to actually see what an end user of the map would see at any particular moment. That means saving out the JSON and referencing the file in that other demo

We're not sure what options are available for this, but things we discussed:

  • Having one or more sets of prefiltered tilesets to use for styling (eg 1700, 1800, 1900). This seems feasible but a bit inefficient and inflexible, since any target item for styling might be in any year
  • Modifying Maputnik to somehow allow tile filtering or inserting the timeslider.
  • One more I just thought of -- if we could find where Maputnik stores the JSON style object for its own rendering (maybe in local storage somewhere?), I wonder if we could have a variant of the timeslider demo that easy to run locally and references the live style as it is edited in Maputnik. Still would mean two windows and a lot of refreshing, but faster than a full save/reload cycle. Even cooler would be if the timselider demo could lsiten for changes in Maputnik's local file and hit reload...

Activity

  1. danrademacher commented on Apr 25, 2023

    @danrademacher
    Author

    cc @1ec5 Here's the ticket with some ideas for making local styling easier with time filtering. I'm curious what you think about that last idea -- a variant of a simple JS demo that references the JSON one is editing in Maputnik

  2. 1ec5 commented on Apr 25, 2023

    @1ec5
    Member

    Modifying Maputnik to somehow allow tile filtering or inserting the timeslider.

    Maputnik is a local Web application, so it should be pretty straightforward to fork it and host the fork on GitHub Pages. Assuming that’s the case, I wonder if leaflet-ohm-timeslider-v2 is in a state where it would be possible to integrate it into that fork of Maputnik. Then we don’t even have to juggle tabs.

    Maputnik is a React application, which makes things slightly more complicated, but for example here’s where it installs Mapbox GL plugins and where it refreshes the style (so we’d want to reapply the time slider’s filters afterwards).

    As a first step, the time slider library would need to be packaged up as an NPM library. This would also facilitate integration with Overpass turbo and other embedded maps (#485).

  3. danrademacher commented on Apr 25, 2023

    @danrademacher
    Author

    Interesting. We have occasionally published NPM packages, so I think that part is readily feasible. It would be really nice if we could modify a Maputnik fork in a way that was easily maintained and kept in sync with upstream. Maybe that's a case where React's modularity would work in our favor. Then agian, it doesn't look like Maputnik's code base is changing all that rapidly.

  4. 1ec5 commented on Aug 10, 2024

    @1ec5
    Member

    As a first step, the time slider library would need to be packaged up as an NPM library.

    maplibre-gl-dates is the new NPM library for filtering the map by a date, but it includes no UI. We’d need to start a separate NPM library for the slider UI (which might be a good opportunity to redesign it for compactness).

  5. 1ec5 commented on Feb 8, 2025

    @1ec5
    Member

    #914 tracks building a reusable time slider UI.

  6. added theissue type on Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions