codeforamerica/transitmix — pull request #13 by samhashemi (2014-04-18 23:52:06+00:00)
Title: Enable click-and-drag to reroute

Big ups to @dget for figuring out a lot of this logic.

This branch:
- Enables hovering over the line, getting a new marker, and then clicking-and-dragging that marker to reroute a part of the line. The DOM events involved here are a bit complicated (the map, the polyline, and the marker all interact), so if anyone wants to take a stab at improving in the future it would be welcome.
- Enables click-to-delete on markers.
- Cleans up the model with a standard naming convention: addWaypoint/updateWaypoint/etc. Basically think of the line as an always-routed set of latlngs, going through the given waypoints.
- Adds JSHint support, for beautiful code. Uses the AirBNB style guide: https://github.com/airbnb/javascript