Log in

No account? Create an account
entries friends calendar profile Previous Previous Next Next
Bus Map - Qualified Perceptions
Bus Map
I've been playing around with the Google Maps API and teaching myself Javascript (Javascript Lesson One: "there is no here here"), and have proof-of-concept (that is, the routes through 100) for an MBTA bus map (because I never know where any of the busses go).


I find that I have really no particular knack for nice-looking UI, so if anyone has suggestions (or CSS files!) let me know.

As far as the actual functionality goes, bug reports and suggestions also welcome. (I can't figure out a good way to allow hitting return to work for the text entry fields without triggering a page reload...)

Current Mood: accomplished accomplished

18 comments or Leave a comment
jadia From: jadia Date: September 1st, 2006 06:15 pm (UTC) (Link)
Hm. It made my mozilla complain that it had a script that made it run slowly, so I didn't actually let it load. It sounds interesting, though!
firstfrost From: firstfrost Date: September 1st, 2006 06:19 pm (UTC) (Link)
Yeah, it does take a little while to load because it has to pre-load all the data. I don't know enough javascript yet to get past that. :-\
(It should be safe to let it run and then kill the tab after you're done, though; I checked it for memory leaks fairly recently and it didn't seem to have any).
From: readsalot Date: September 1st, 2006 06:39 pm (UTC) (Link)
I like having different colors for the different routes, but some of them were unreadable because black printing doesn't show up well on dark blue backgrounds, for instance.

Firefox also complained about slowness, but when I told it to keep going, it was ok.

firstfrost From: firstfrost Date: September 1st, 2006 06:48 pm (UTC) (Link)
Hee, I tried putting them in semi-transparent, but grey text on lighter grey blue is not any more readable. :)
firstfrost From: firstfrost Date: September 1st, 2006 07:32 pm (UTC) (Link)
There! The boxes are ligther! :)
From: readsalot Date: September 1st, 2006 08:06 pm (UTC) (Link)
I still find it a little difficult to read the darkest blues, but it's much better than before. Yay!
jaedian From: jaedian Date: September 1st, 2006 07:59 pm (UTC) (Link)
Don't have much need for bus info, but it is very cool

ricedog From: ricedog Date: September 2nd, 2006 12:40 am (UTC) (Link)


I have even less use for this than jaedian does, but you have atoned for hundreds of thousands of worse than useless java apps that others have authored. :)

I especially like the T stations.

dzm From: dzm Date: September 1st, 2006 08:29 pm (UTC) (Link)
Nifty! How did you get the bus map data? It looks like you have it all as a static JavaScript file, which should work. Feature-wise the two things I might request are an option to clear all the selected routes (easy) and an option to show all of the routes at a given point (probably trickier). You should also feel free to steal ideas/code from my bike trip page which has a kind of similar theme to it.
firstfrost From: firstfrost Date: September 1st, 2006 08:41 pm (UTC) (Link)
I'm entering the bus map data from the MBTA PDFs on gmap-pedometer using GMapToGPX. So it's kinda slow (hence only 100).

"Clear all routes" would be a good button to have, though "reload page" does work for that in a pinch, which is why I was lazy and haven't added it. You should be able to show all the routes at a point by clicking to set a marker and then doing "select routes near locations" of some small distance.

I should figure out how to let you put a marker on top of a point, which doesn't currently work because the marker is grabbing the mouse event or something like that.

Your bike trip page was totally cool and inspirational when I saw it; the changing color trails in particular was very impressive. :)
fredrickegerman From: fredrickegerman Date: September 3rd, 2006 12:18 am (UTC) (Link)


The bike page hasn't been Safari-compliant in quite a while, and looks really obviously broken on my machine. Boo! (I feel like it once worked in simpler times.) Whereas the bus map seems to mostly work fine, except I can't quite get "highlight routes near a location" to work right (and of course it's terribly slow due to all that data being loaded).

I wonder if there's a way to make the data load lazily---maybe put the data for each route in a separate file and somehow slurp it in when a given route is displayed. But my JavaScript is basically non-existent, so...
merastra From: merastra Date: September 1st, 2006 11:41 pm (UTC) (Link)
This is cool!
And proves yet again that you (and your clones) have Too Much Time On Your Hands.

I could probably come up with user interface suggestions at some point if you like.
(Deleted comment)
psychohist From: psychohist Date: September 2nd, 2006 01:40 am (UTC) (Link)
That's pretty cool!

I think you can use Javascript onsubmit() to intercept the return key. Have the function return false to avoid submitting the form.
firstfrost From: firstfrost Date: September 2nd, 2006 03:38 am (UTC) (Link)
I have onsubmit set to return false for both of those; that definitely keeps it from submitting, but it also keeps it from doing anything like parsing the input if you hit return, too, and people seem to expect hitting return after an input to *do* something. :)

(I played around with using onchange, but that seemed to not work with IE. Darned platform compatibilities.)
From: (Anonymous) Date: July 7th, 2007 09:11 pm (UTC) (Link)

Thanks so much

This is a great tool.

Thanks again
From: spacefrog37 Date: February 10th, 2010 04:15 pm (UTC) (Link)
I am by no means a programmer, but it doesn't seem like there is anything like this out there. Is it somehow possible to overlay this data on a personal Google Map? I'm having a college reunion over the weekend and started making a map for us with Google Maps. But, the things we want to check out are spread out and the less driving the better (we can't really afford cabs). It would be great to be able to know how and if we can get around. I'd love to really be able to plan things sequentially somewhat, and have the possibility of modifying our plans visually on the fly, maybe with a mobile phone even. I guess like an enormous, lengthy pub crawl through the larger city.

Is your work open-source or would I have to recreate it?
firstfrost From: firstfrost Date: February 10th, 2010 04:23 pm (UTC) (Link)
Hmm, I stopped maintaining this (the search no longer works properly) when the MBTA web site (mbta.com) updated to have a decent Google map interface that displayed the bus routes. It's not perfect, but it does actually know where the bus stops really are, which my map doesn't, and the search-by-location works decently.

Anyway, my understanding of the Google API and license is that I can use data I extract from their API for my own personal use, but I can't publish it on my own.
18 comments or Leave a comment