Covid-Self-report-Tool / cov-self-report-frontend

Frontend repository for COVID-19 self-reporting tool in React
https://www.covidselfreport.org
MIT License
10 stars 1 forks source link

🐛 Bug -- Map: prevent re-render when switching routes #79

Open abettermap opened 4 years ago

abettermap commented 4 years ago

Description

Not really a bug but... it's annoying that your map position and (eventually if/when we have a control for it) current symbology is lost when you leave the map page and come back.

Expected behavior

Map view should stay as-is when switching between pages.

How to reproduce the problem

  1. Zoom in on the map.
  2. Go to About page.
  3. ...then back to map.

Zoom and extent are back to the initial.

Related items

Jira CSR-64

Resolution

Sub-routes do not see the way to go here, but maybe in react-router v6.

Jason idea: rm map from route. Show 24/7, but have all non-map non-modal routes in a <Switch> component inside a generic layout component with zIndex higher than map.