GreenInfo-Network / nyc-crash-mapper

React Redux web application for viewing, filtering, & comparing trends of automobile collision data published by the NYPD.
http://www.crashmapper.org
MIT License
16 stars 4 forks source link

Select area type but not an area = Button selected but no GeoJSON #77

Closed gregallensworth closed 6 years ago

gregallensworth commented 6 years ago

When a specific area is selected for filtering, this is preserved properly on page reload:

However, when an area type is selected but not a specific area the UI behavior is a bit weird.

In short: When loading initial state from URL params, if a geo is given but an identifier is not, the behavior should be as if one had just clicked the geo button, loading the GeoJSON and all.

Example URL: http://crashmapper.org/#/?cfat=true&cinj=true&endDate=2017-12&geo=nypd_precinct&identifier=&lat=40.70616014451694&lng=-73.977805&lngLats=%255B%255D&mfat=true&minj=true&noInjFat=false&pfat=true&pinj=true&startDate=2017-12&zoom=11

gregallensworth commented 6 years ago

Area type is selected but no a specific area. Clickable polygons are presented.

http://localhost:8080/#/?cfat=true&cinj=true&endDate=2017-12&geo=nypd_precinct&identifier=&lat=40.706148461723764&lng=-73.97712707519531&lngLats=%255B%255D&mfat=true&minj=true&noInjFat=false&pfat=true&pinj=true&startDate=2017-12&zoom=11

A specific area type & area are both given. Filtering is performed to that selected area.

http://localhost:8080/#/?cfat=true&cinj=true&endDate=2017-12&geo=nypd_precinct&identifier=112&lat=40.72514478577349&lng=-73.84503364562988&lngLats=%255B%255D&mfat=true&minj=true&noInjFat=false&pfat=true&pinj=true&startDate=2017-12&zoom=14

Neither given, no area type nor area selected

http://localhost:8080/#/?cfat=true&cinj=true&endDate=2017-12&lat=40.72514478577349&lng=-73.84503364562988&lngLats=%255B%255D&mfat=true&minj=true&noInjFat=false&pfat=true&pinj=true&startDate=2017-12&zoom=14