Closed gregallensworth closed 5 years ago
MBGL portion working. The MBGL demo now includes two new TimeSlider
controls: UrlHashWriter
and UrlHashReader
These do as expected: Reader will do a one-time apply of URL params to set the map state, and Writer will sit and watch the map and slider every second and update URL params as necessary.
Note that this is new ground here in some ways. URL params have a mostly de-facto standard of #12/34.567/-123.456
as being zoom, latitude, longitude. However, there is no standard for extending beyond these, so my new addition /date,mindate-maxdate
is somewhat ad-hoc because it seems good and readable and extensible. We may be compelled to change this as needs and date-representation standards develop.
Leaflet wrapper now working:
URL params are loaded into initial state, then tracked ongoing.
Again, a thin wrapper over the existing MBGL controls so as not to duplicate the logic. If Leaflet ever gets better support for vector tiles, maybe it would make sense to rewrite all three items (TimeSlider, UrlHashReader, UrlHashWriter) from scratch to those native libraries... while also keeping their URL spec implementations in sync. But at this time, MBGL is the only game in town so it's what we're using.
Expanding on the MBGL TimeSlider control demonstration, built in #33
Implement on this demo, a new map control which will write URL params of the map's state, and on startup will read URL params to set the map's state.
X/Y/Z center and zoom
Selected date
Currently-selected date range
[x] MBGL version for this demo
[x] Leaflet version for its demo