Thursday, August 19, 2010

More Tracking

I continue to tweak the map resulting from the tracking info (see my updated video). I implemented a suggestion in this thread to grab the "address" corresponding to the longitude/latitude of a sample. That now shows up as the location when mousing over a marker. The mouseover kicks off an AJAX fetch of the geolocation info from Google Maps, which processes the JSON data and fills the popup. Clicking the marker brings updates the popup to show 3 nearby items and clicking it again brings up the original data.

A major change is I'm now using the Google Maps direction service and renderer to do the actual distance calculations between two markers and to draw the line connecting them. This ends up being a lot more accurate than my original straight line calculation and, of course, the line actually follows the road traveled. The more accurate distance calculation means a better speed estimate for that interval as well.

Right now, the code is a disaster, but I plan on putting it on my website after I clean it up.

No comments:

Post a Comment