I spent the better part of a week or so adding support for polylines into Flagship Geo. The hard part wasn’t the data structure development, it was the ability to easily edit the lines in a way that made sense.
Google Maps works as a great User Interface control for maps, but its just a control. You have to tell it what to do when someone drags a marker around or clicks on the map, there is no automatic way to tell it that the person is trying to edit the line. All the objects people can interact with need event handlers written for them, which reminds me a lot of regular desktop application development. I usually take for granted the fact that a tag like <a href=”#”></a> will automatically know what to do when clicked. Tools like jQuery make it easily to build on those actions, sending that a href into a AJAX library or something. Building the polyline editing interface was much more like building a desktop application in C, Python, or alike where you have to bind everything yourself.
You can take a look at the commit where most of this code was sent along here: http://github.com/bamnet/flagship_geo/commit/f2e8e113bcaef2a78573d8f5569e10f18bc8de4a