azavea/OTM2 — pull request #825 by RickMohr (2013-10-30 21:05:15+00:00)
Title: Map state

Create mapstate.js and refactor map.js to use it
* mapstate.js serializes/deserializes map state to a URL query string
* State includes map center and zoom level, current OTM search, and whether you're in "Add Tree" mode
* Values from the URL are communicated via `stateChangeStream` and handled in map.js
* App state changes are recorded in the URL via `setZoomLatLng`, `setSearch`, and `setModeName` functions

Cleanup:
* Remove utility.js functions (integrated into mapState.js)
* Remove `ADD_TREE_URL_HASH` from settings.py and `addTreeUrlHash` from settings.js

Also simplify/clarify stream logic in map.js:
* Eliminate single-use Bacon streams. Fewer named streams makes the logic easier to understand.
* For clarity, use Bacon.mergeAll to merge two streams. To me it's clearer this way when you're also doing something to one or more of the streams.
* Reorder code in init() so first we set up all streams and event handlers, and second we init everything

Also change inlineEditForm's inEditModeProperty to not fire an initial value
* Simplifies initialization in map.js
* Simplifies plot.js