WorldMaps and Virtual Earth

Some might think this is a long overdue piece of functionality, but at long last, I've got a working sample of integrating WorldMaps and Virtual Earth.  I demonstrated how this works in a recent MSDN Roadshow Chad and I completed recently in Charlotte. 

To check out how this works, you can see my modified stats page here:

http://www.structuretoobig.com/worldmapv2.aspx?userid=fecb0aff-083e-4f42-9b08-9a01e3cb714a

If you're using WorldMaps, just point to worldmapv2.aspx instead of worldmap.aspx for the reporting page.  Eventually I'll roll the functionality back into the original version.

Near the top of the page, there's a Virtual Earth link that will display this version of the map.  Click this link, and when the Virtual Earth version loads, you can browse and zoom the map interactively.  

Now, the big problem with regards to my service and Virtual Earth is that I can't load potentially tens of thousands of hits simultaneously.  To get around that problem, I group all of the hits and IPs by latitude/longitude, and display the top 250 in the given view of the map.   

When the map loads or when the view changes (for example, the map is scrolled or zoomed), I ping a web service that determines the top 250 hits given the current dimensions of the map.  (250 seems to be a safe number to work with -- but it's arbitrary.  I could just as well pick 150 or 500, but I'm treading carefully based on the performance I see.)  So as you zoom in, you'll see more hits that would otherwise not be shown on a world map.  While this is primarily for performance, it's also effective at reducing clutter.

Another cool feature is that each hit will display the number of hits at that point, as well as the number of IPs coming from that location.  Cool, huh?

Over the next few days (I hope), I'm going to blog how this is implemented.  It's straightforward, thanks to Virtual Earth and ASP.NET AJAX doing most of the heavy lifting.  More coming soon!

Comments (2) -

Anonymous
Anonymous
9/18/2007 5:21:37 AM #

Maybe when you group by latitude/longitude, you could have a fudge factor that grows as the map view zooms out.  That way points that are closer to each other would get grouped together as you zoom out and would break apart as you zoom in.  The trick is to figure out the fudge factor, though.

Brian
Brian
9/18/2007 12:15:28 PM #

Exactly.  What you're talking about is clustering, and coming up with a good algorithm to do this is difficult.  Most simple clustering groups points at given intervals (your fudge factor).  When the map is zoomed out enough, you've got more wiggle room as the perceived space shrinks so you can cluster larger areas together.  But as you zoom in, this gets more difficult.  All in good time, though!

Comments are closed

My Apps

Dark Skies Astrophotography Journal Vol 1 Explore The Moon
Mars Explorer Moons of Jupiter Messier Object Explorer
Brew Finder Earthquake Explorer Venus Explorer  

My Worldmap

Month List