mit-jp / mit-climate-data-viz

Plotting climate data for the MIT Joint Program on the Science and Policy of Global Change
https://cypressf.shinyapps.io/eppa-dashboard/
0 stars 0 forks source link

Allow linking to specific map #265

Open cypressf opened 2 years ago

cypressf commented 2 years ago

Problem

I cannot link to a specific map, like est.mit.edu//. Instead, I can only link to a tab est.mit.edu/, and it will always load the first map on that tab.

Solution

Add an optional map-id to the path est.mit.edu/:tab-id/:map-id, and load that specific map in that tab if it exists. Change the map selection inputs to links that alter the map-id in the url. If no map-id exists in the url, load the default map in that tab instead.

Progress so far

I started working on the map-routes branch (TEMP).

I need to figure out two things:

1) how to link to a map route without appending the /<map-id> to the current url (even if it already has a map id on the end of it) 2) how to prevent the state from breaking when a url with a map-id in it is loaded directly, before the website has a chance to load the necessary map_visualization to understand what start_date, end_date, and source to use for that map id.