Bus Map

Sep. 1st, 2006 01:07 pm
firstfrost: (Default)
[personal profile] firstfrost
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).

http://web.mit.edu/boojum/www/Map/

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...)

Date: 2006-09-01 06:15 pm (UTC)
From: [identity profile] jadia.livejournal.com
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!

Date: 2006-09-01 06:19 pm (UTC)
From: [identity profile] firstfrost.livejournal.com
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).

Date: 2006-09-01 06:39 pm (UTC)
From: [identity profile] readsalot.livejournal.com
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.

Date: 2006-09-01 06:48 pm (UTC)
From: [identity profile] firstfrost.livejournal.com
Hee, I tried putting them in semi-transparent, but grey text on lighter grey blue is not any more readable. :)

Date: 2006-09-01 07:32 pm (UTC)
From: [identity profile] firstfrost.livejournal.com
There! The boxes are ligther! :)

Date: 2006-09-01 08:06 pm (UTC)
From: [identity profile] readsalot.livejournal.com
I still find it a little difficult to read the darkest blues, but it's much better than before. Yay!

Date: 2006-09-01 07:59 pm (UTC)
From: [identity profile] jaedian.livejournal.com
Awesome!
Don't have much need for bus info, but it is very cool

Wow

Date: 2006-09-02 12:40 am (UTC)
From: [identity profile] ricedog.livejournal.com
I have even less use for this than [livejournal.com profile] 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.

Date: 2006-09-01 08:29 pm (UTC)
From: [personal profile] dmaze
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.

Date: 2006-09-01 08:41 pm (UTC)
From: [identity profile] firstfrost.livejournal.com
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. :)

Sadly...

Date: 2006-09-03 12:18 am (UTC)
From: [identity profile] fredrickegerman.livejournal.com
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...

Date: 2006-09-01 11:41 pm (UTC)
From: [identity profile] merastra.livejournal.com
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.

Date: 2006-09-01 11:55 pm (UTC)
navrins: (Default)
From: [personal profile] navrins
Very interesting...

Date: 2006-09-02 01:40 am (UTC)
From: [identity profile] psychohist.livejournal.com
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.

Date: 2006-09-02 03:38 am (UTC)
From: [identity profile] firstfrost.livejournal.com
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.)

Thanks so much

Date: 2007-07-07 09:11 pm (UTC)
From: (Anonymous)
This is a great tool.

Thanks again

Date: 2010-02-10 04:15 pm (UTC)
From: [identity profile] spacefrog37.livejournal.com
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?

Date: 2010-02-10 04:23 pm (UTC)
From: [identity profile] firstfrost.livejournal.com
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.
Page generated Feb. 17th, 2026 05:53 am
Powered by Dreamwidth Studios