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: , ,