NYCPlanning / labs-regional-viz

An interactive mapping experience that highlights regional planning data and trends.
Other
6 stars 1 forks source link

When toggling a summary level mode and navigating, maps appear blank #65

Closed allthesignals closed 6 years ago

allthesignals commented 6 years ago
  1. Toggle municipality for a layer
  2. Navigate to a layer without municipality

Map will be blank

There should be better handling for this

andycochran commented 6 years ago

This shouldn't be an issue. When navigating to a map, the geographyLevel should be reset to that map's default level. I don't think that's documented in an issue, so we can change this one to be about that.

allthesignals commented 6 years ago

I don't follow... I'm saying it should be toggled to default.

andycochran commented 6 years ago

The selected geographyLevel should not persist across maps. It should alway reset to the maps' default, regardless of whether the geographyLevel on the previous route is available on the route being navigated to.

allthesignals commented 6 years ago

Aaah gotcha. Hmm. I think we're passing the geographyLevel down from the controller. Since controllers are singletons, the state will persist. Or, maybe we adjust the scope param? Not sure.

andycochran commented 6 years ago

I think we should add defaultGeographyLevel: [subregion, county, municipality] to each map.yaml and use that to set it on the controller. I'll try to take this one…

andycochran commented 6 years ago

The map.js controller never needs to know about the geography level. I've successfully moved that to a computed in map-from-id.js. Just need to finish that up (finding it to be buggy after switching levels).