MARTA map changes

Posted by David on Feb 24th, 2007

I’ve been playing around with the MARTA map again trying to add in some of the bus routes. I’ve been working my way North to South and have a few added, but one thing I noticed pretty quickly is that adding a lot of polylines to the google map slows it way down. Ajax is pretty damn slow to begin with, so this just won’t do. One workaround I found was to use an undocumented tile overlay feature. Google maps allows for custom tile overlays to be created, and since these are just a set of PNGs like the rest of the map data, it doesn’t tax the browser any more than displaying all the streets and stuff. There’s also a trick you can use to get Google to make the tiles for you based on a KML file, similar to how you can put a KML URL into the Google Maps search box and see it displayed on the web. I’ve switched the rail and bus routes to KML, but I’m not sure how long this will work.

One of the bigger backend changes I made when I copied David’s map was to put the data in an XML file. I’m not a huge fan of XML and all it stands for, but it makes more sense to have the data in XML than to encode it in Javascript, and I expanded on that to create a big ridiculous schema so I can pursue hopeless dreams of creating route searches, kind of like Google Transit. This decision allowed me to generate KML from this source data file, but I still use the original XML for marker placement since the KML overlay doesn’t allow as much flexibility as far as information formatting, and I need to make my own marker objects in order to provide that station search form. That soure file is pretty big and unweildy, though, so I’m thinking of creating more compact XML files from this source file containing just the data needed for the map.

One of the limitations of the KML overlay, besides it being undocumented, unsupported and possibly a violation of the terms of use, is that KML files are limited 1MB. That’s a pretty good number of bytes, but I’m already at 84k with only eight routes. I may end up having to generate my own tiles yet.

Leave a Comment




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>