codeforamerica/MuniciPal — pull request #116 by techieshark (2014-11-09 22:58:13+00:00)
Title: simplify addresses_controller, highlight selected district, and fix example address link

This does a few things:

* When a user selects a councilmember (district) from the menu, we center the map over the district and place the marker at the center of the district's bounding box. Previously, with PostGIS, we used [ST_PointOnSurface](http://postgis.refractions.net/docs/ST_PointOnSurface.html) to get a point guaranteed to be within the polygon, but this works almost as well except for when you select district 3 or 6 the center isn't actually inside the district (due to a weird shaped district in the first case, and a county island in the second case).

* This code simplifies addresses_controller (and moves a little bit of logic to js-land as a result, to handle the case where there is no lat/lon returned). This also has the effect of taking out a hard-coded lat/lng inside addresses_controller (and we use `center_location` and `marker_location` in `config.js` instead).

* Ensures that clicking the example address doesn't take you back to the mayor's page if you are there.

This is related to #44.
This closes #32.