nprapps / elections18-graphics

2018 midterm election front-end; iteration upon 2016 GE work
MIT License
5 stars 1 forks source link

Suggest a home state in the nav bar, next to `State Results` #36

Open mileswwatkins opened 6 years ago

mileswwatkins commented 6 years ago

In the elections nav bar, use geolocation to suggest a single state to view, as a shortcut to readers so they don't need to click through State Results.

I checked with DM, and they said that there's no current endpoint for us to use on the npr.org front-end (since DM already captures geolocation for use with the member-station audio player). Tyler Sullens is double-checking with the dev managers to see if there're plans to build such an endpoint.

alykat commented 6 years ago

Alternately, in the course of its member station geolocation, DM saving any useful info to a cookie/localStorage we could access?

mileswwatkins commented 6 years ago

Based on conversations it doesn't seem so, and it also sounds like they don't cache the geolocation call between different user requests either.

alykat commented 6 years ago

The best I see is the geolocated member station information in localStorage under PLAYER_STATE — but even then it's just the marketState for the station, not the user's own state.

mileswwatkins commented 6 years ago

DM is looking into this, we may actually get an endpoint. I also mentioned that we'd be happy with a user's state to be stored in a cookie, if that's easier for them.