Closed danrademacher closed 6 years ago
Looks like values in geo
are different between the two, however. In chart, we have geo=city_council
but in map City%20Council%20District
.
Need to normalize map values to match chart? Or just do a crosswalk?
It would probably make sense to normalize them. I'll have to take a look at how the map handles parsing the query params.
@danrademacher the problem I'm running into with this is that the chart view app has no way of knowing what the map zoom and center should be. So while the other query params may be sent, the map will load without being zoomed and centered on the desired area.
Here's an example stateful URL that would be used from the chart view to point to the map view so you can see what I mean: http://crashmapper.org/#/?cfat=false&cinj=true&endDate=2017-11&geo=city_council&identifier=27&mfat=false&minj=true&pfat=false&pinj=true&startDate=2016-11
Oh but I haven't yet pushed the updates to the Map view that would make that work so nevermind.
Noting that a possible solution could be for the map view to request the polygon that matches "geo" and "identifier", then use the polygon to set the map zoom and center, but that would be another feature to build out in the map.
Suppose another alternative is to store the map zoom and center in the chart view app when a user comes from the map view app. That way if someone wasn't changing their geography type or identifier they could go back and forth between the two. This isn't an ideal solution though as it assumes that someone isn't changing the geo type or identifier.
I wondered about that, forgot to note possible simpler solution: Just default map zoom to whole region, but keep geom selected. Like this: http://crashmapper.org/#/?cfat=false&cinj=false&endDate=2017-11&geo=City%20Council%20District&identifier=3&lat=40.70484714530104&lng=-73.89678955078125&lngLats=%255B%255D&mfat=false&minj=false&noInjFat=false&pfat=false&pinj=false&startDate=2017-11&zoom=11
Maybe not ideal, but would allow just a single "baked" or static set of center and zoom coords coming from Chart to Map
Hmmm, I suppose that could work as a temporary solution.
Known need we hadn't logged: Enable link back to Map view.
First task: Decide which params to carry over.
Sample Chart UI params:
Map UI Params for a similar search:
Matching the two: