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
Actually, I believe this is a superset of #88, so I'll just add that here & close #88.
What's your idea for a cool feature that would help you use OHM better.
Right now, the map always defaults to a static year and date range, so you cannot share a particular year view of the map.
It would be awesome to be able to embed the year of the map display in the URL.
That way you could:
Link directly to ancient Rome
A civil war battlefield in the year of the battle
a year before a border changes
Current workarounds
Only to tell people when you pass them the link.
I believe @rwelty1889 wanted to be able to include the following in the URL as optional parameters:
Slider min
Slider max
Slider setting
My question is whether it's possible to expose the current slider state to other apps/widgets, so the slider controls more than just the map? e.g. how do you make the inspector time-aware to show the most time-appropriate pictures by default? (that's not in this ticket, but a question)
My question is whether it's possible to expose the current slider state to other apps/widgets, so the slider controls more than just the map? e.g. how do you make the inspector time-aware to show the most time-appropriate pictures by default? (that's not in this ticket, but a question)
This meets the requirement in this ticket for slider min, max, and setting.
The task here is to see how it conflicts with the existing URL hash inohm-website and how we can resolve those conflicts with least possible change to default OSM website code
I don't think this will be a pure implementation of the urlHashWriter/Reader we have on the timeslider right now.
Rails app expects a hash like this: #map=16/51.5292/-0.1543&layers=OD
Timeslider expects a hash like this: #16.6/40.8217108/-73.9119449/1980,1970-2000
The layers=OD needs to be retained, since that's the map layer that's selected. There are other raster layers available where our timeslider disappears and you just have a usual Leaflet map, so they use the map= value as it is now.
I wonder if the best approach with be a variant of the hadreader/writer that operates ONLY on the year pieces? So we do something like #map=16/51.5292/-0.1543&layers=OD&time=1980,1970-2000 and include options in the URL Hashwriter/reader that looks only for that?
Just my first thought -- could be there's a simpler way to use what we have. Our goal is always to make as few changes as possible to the Rails app (eg change how it handles params), so it's easier to stay in sync with OSM upstream and manage OHM-speciifc code separately.
Looking good! In my local testing, the selected date hash is respected, but the RANGE is not always. If I reload the page, it all works as I expect, but if I select a non-time-aware basemap and then switch back to this map, the settings SOMETIMES revert to defaults.
If I load the page with either Humanitarian or Standard OSM, there's no time params loaded and then we get an error and no timeslider. Maybe we could load a default state if none are supplied in URL?
Can you base next change on this directly on new-inspector? I already merge dinto that, and once this bit is working, I'll merge it all into staging and run another deploy.
Activity
jeffreyameyer commentedon Jun 27, 2020
Related to #88, but that is not a dupe.
jeffreyameyer commentedon Jan 23, 2021
Actually, I believe this is a superset of #88, so I'll just add that here & close #88.
What's your idea for a cool feature that would help you use OHM better.
Right now, the map always defaults to a static year and date range, so you cannot share a particular year view of the map.
It would be awesome to be able to embed the year of the map display in the URL.
That way you could:
Current workarounds
Only to tell people when you pass them the link.
jeffreyameyer commentedon Jan 23, 2021
I believe @rwelty1889 wanted to be able to include the following in the URL as optional parameters:
My question is whether it's possible to expose the current slider state to other apps/widgets, so the slider controls more than just the map? e.g. how do you make the inspector time-aware to show the most time-appropriate pictures by default? (that's not in this ticket, but a question)
danrademacher commentedon Jan 25, 2021
This should be a separate and exploratory issue:
the near term fix we need is to instantiate the
urlHashReaderandurlHashWritermethods we have documented here:https://github.com/OpenHistoricalMap/mbgl-timeslider#additional-tools-urlhashreader-and-urlhashwriter
We have a demo here:
https://openhistoricalmap.github.io/mbgl-timeslider/demo/
This meets the requirement in this ticket for slider min, max, and setting.
The task here is to see how it conflicts with the existing URL hash in
ohm-websiteand how we can resolve those conflicts with least possible change to default OSM website codejeffreyameyer commentedon Jan 25, 2021
Done! #187
Near-term fix sounds great!
danrademacher commentedon Jan 25, 2021
I don't think this will be a pure implementation of the
urlHashWriter/Readerwe have on the timeslider right now.#map=16/51.5292/-0.1543&layers=OD#16.6/40.8217108/-73.9119449/1980,1970-2000The
layers=ODneeds to be retained, since that's the map layer that's selected. There are other raster layers available where our timeslider disappears and you just have a usual Leaflet map, so they use themap=value as it is now.I wonder if the best approach with be a variant of the hadreader/writer that operates ONLY on the year pieces? So we do something like
#map=16/51.5292/-0.1543&layers=OD&time=1980,1970-2000and include options in the URL Hashwriter/reader that looks only for that?Just my first thought -- could be there's a simpler way to use what we have. Our goal is always to make as few changes as possible to the Rails app (eg change how it handles params), so it's easier to stay in sync with OSM upstream and manage OHM-speciifc code separately.
OpenHistoricalMap/issues#108 time slider URL params
gregallensworth commentedon Jan 26, 2021
This is in place in the new gda-timeslider-urlparams branch, itself a branch from new-inspector.
The new hash components are more OSM-style rather than
z/x/ystyle: a&date=and&daterange=parameter.http://localhost:3000/#map=21/47.60187/-122.33327&layers=O&date=1861&daterange=1750,1950
danrademacher commentedon Jan 26, 2021
Looking good! In my local testing, the selected date hash is respected, but the RANGE is not always. If I reload the page, it all works as I expect, but if I select a non-time-aware basemap and then switch back to this map, the settings SOMETIMES revert to defaults.
As shown in this screenscast, when I change the min date, then navigate away, the timeslider reverts to default:
https://recordit.co/rdWoohYN96
Merge pull request #28 from OpenHistoricalMap/gda-timeslider-urlparams
danrademacher commentedon Jan 29, 2021
Hmm, a case where I can break the timeslider.
Screencast: https://recordit.co/lLyC7Hh8xs
If I load the page with either Humanitarian or Standard OSM, there's no time params loaded and then we get an error and no timeslider. Maybe we could load a default state if none are supplied in URL?
Can you base next change on this directly on
new-inspector? I already merge dinto that, and once this bit is working, I'll merge it all intostagingand run another deploy.danrademacher commentedon Feb 2, 2021
Deployed to production and working as here:
https://www.openhistoricalmap.org/#map=20/47.60172/-122.33232&layers=O&date=1964&daterange=1,2021