HarlanH/code-for-dc-edu — pull request #50 by sleitner (2013-09-09 05:36:43+00:00)
Title: activating buttons

These commits make the button filters functional. Each click actually
rebuilds all the layers (unnecessarily expensive) by calling the
original layer construction scripts. Now though, the extra fields are
used to restrict the data. nc_centers needs a "ward" key because,
as-is, the schools map restricts by the school's ward (if the school is
not in the selected ward nothing appears on the map -- not very
interesting). For the neighborhood map, elementary/middle/high schools
are defined ONLY as places with grades 1-5/6-8/9-12, and public schools
are "Regular schools". Finding active buttons is stupidly complicated
because the onclick function happens before a given button is
activated/de-activated so you have to manually change the button you
click. I do this with a "toggle" argument, but I'm sure there is a
better way.