Monday, September 17, 2007

Flickr, integrated :)
A nice picture of Boulder Colorado, where I got to spend some time this weekend while attending a friend's wedding.


I've been playing around with displaying geo-tagged Flickr images on top of the Virtual Earth map application I made a while back. I'm fairly happy with the results- there's a surprisingly large number of images that are tagged in Flickr so there was a definite abundance of data to display.

The two problems I ran into while getting this to work were marshalling the Flickr data from browser javascript to managed code and ordering all of the network traffic to ensure the app remained responsive. Marshalling the data wasn't too bad, I ended up writing a simple serializer that I'm sure will come in handy in some other projects- notably a Digg viewer that I've been playing around with off and on. The upside is that I've been told that the platform will take care of this marshalling shortly my serializer won't be needed at all.

The network traffic issue is one that was a bit uglier and that I honestly hadn't thought about too much. Every time the user zooms into a location the app is trying to download 20+ images plus all sorts of Flickr requests. The problem is that the browser limits the number of simultaneous network connections and I was running into a bottleneck. The default number of connections for IE and Safari is 2, the Firefox documentation says it allows 8 and the HTTP 1.1 specification says it should be 2.

I ran into the networking bottleneck earlier in the project, but sort of waived it off because it didn't seem too bad, but with the Flickr traffic I ended up having to create an application-wide networking manager that could prioritize all of the traffic and give precedence to the critical stuff. I think it worked out alright and may have even resulted in some improved snappiness.

The source code can be found here.

Labels: , ,

Friday, August 31, 2007

I finally got around to checking my Virtual Earth app on Safari and surprise! it doesn't work.

Turns out the technique I'm using to inject Javascript into the page from managed code isn't compatible with Safari which is breaking the mouse wheel scrolling and something is busted with the back button support. I'm quite bummed about the mouse wheel stuff because I had a cool sample ready to go on how to use it, but the workaround is ugly. Hopefully I'll get it going again soon.

Probably the biggest lesson I've gotten out of this project is that anytime I rely on browser functionality- from layout to javascript, Murphy's Law comes into full effect, productivity drops to nil and frustration boils over.

In the meantime, the app works fine on Firefox on OS X so I'd suggest using that instead. But I'm not giving up on Safari!

Labels: , , ,

Wednesday, August 29, 2007

I've been playing around with a fun little Virtual Earth browser, it seems like everyone is making one these days so I figured I'd make a stab at it as well. It actually turned out to be a lot more fun than I was planning on- I got completely sidetracked by trying to add all the little polishes and got no where close to what I originally had in mind.

Before you read any further, I'd definitely suggest giving it a whirl- http://blois.us/VE

Instructions are basic- use the mouse wheel to zoom and search using the location bar.

Besides really cool zooming, I also tried to integrate into the browser history. I think that I got it working, but haven't tested on Safari yet, so it's really anyone's guess. The result is super fun- when searching multiple places the items get added to the browser history and clicking the back button will zoom you back and forward.

Some random searches to get you started-
Statue of Liberty
White House
University of Colorado (hey! that's where I went!)

I have to admit that I'm quite happy with the result so far- work progressed at a reasonable rate until I got mired in browser hell which happened a few more times than I would have liked. I definitely learned that HTML layout is no fun at all. Can't wait for Silverlight to get layout and be done with it.

I'd like to do some follow-ups with some of the things I learned while making this project, I definitely feel like I have a few more tricks in my bag that will come in handy later.

Sources can be found here. But be warned- I'm sort of hacking the VirtualEarth API and offer absolutely no guarantees for how long it will continue to work.

Enjoy!

Labels: , , , ,