cfpb/mapusaurus — pull request #19 by cmc333333 (2014-05-29 16:35:53+00:00)
Title: Load only census tracts in the viewport

Python-side:
* Adds new fields to census tract models to mark their min/max lat/lon. Comparing the "corners" is significantly faster than a geo query. Updates all existing data to match.
* Adds an end point for loading geo data by viewport (i.e. load all census tracts in this min/max lat/lon)
* Drops page-size down to 250

Javascript:
* Adds underscore
* Completely rewrites loading logic to account for paged data
* Adds some hooks for multiple layers (e.g. tract: {minority: ...}) but isn't consistent enough to be used out of the box
* Basic flow:
* when viewport changes (or is initialized), start loading geo data, page by page
* as geo data comes in, check if the associated stat data is present. If so, draw. If not, start loading stat data
* as stat data comes in, store anything that's not relevant (because the geo isn't loaded). Everything that is relevant (and not already drawn) should be drawn