My presentation at the RDU Code Camp was based on a hurricane tracking demo I created using Virtual Earth and Silverlight with a little Ajax thrown in just for kicks. If you want to see the demo click here and if you want to see how it was done you can download the project files here. If you don't already have the Silverlight 1.0 plug-in installed you can download it at www.silverlight.net.
Demo Overview
The demo plots historical hurricane data from the years 1851 to 2005 for the North Atlantic basin. I downloaded the data from NOAA (National Oceanic & Atmospheric Administration) and imported it into a SQL Server Express database. The data is retrieved through a web service and ASP.NET AJAX. To load a storm you use the two cascading drop down lists to first select the year followed by the storm. This will trigger a call to the web service to retrieve a custom business object that contains all the data for the storm. At this point is where all the major elements work together and build the presentation. Once the storm data is loaded a client side method is called to build the XAML needed by Silverlight to plot the storm's path and to also animate the rotating storm icon to move along the storm's path and its color to indicate its magnitude. In order to properly plot the storm Virtual Earth is used to translate the longitude and latitude into pixels. Now because Silverlight is sitting on top of Virtual Earth you lose the ability to control the map because Silverlight is blocking the mouse events. That is why there are six buttons in the upper left hand corner for controlling the map. The arrow buttons start and stop panning and the remaining two controls the zoom. Whenever the map is changed Silverlight must redraw the map. This is achieved by wiring up Silverlight mouse events to call Virtual Earth panning and zoom methods and also wiring up Virtual Earth map events that trigger the client to rebuild the XAML and call Silverlight methods to redraw the storm.
The moral of this Demo.
Now this demo is not by far as eye popping as the really cool Silverlight examples that you'll find at www.silverlight.net , but what I wanted to convey in my presentation (a now this blog post) is the new potential we now have as web developers. I took a complex set of data and presented it in a manner that is understandable by a wider audience and thus enhancing the user experience. Before my options would have been a data grid (boring) and if I wanted to plot the data on a map I would have to write my own server side control or purchase an expensive third-party control. Oh yeah there's Flash and up until now would have been the only way to achieve this kind of user experience. If you discount the code I wrote for the data tier this demo is less than 500 lines of code and that includes the markup with most of it being JavaScript. There was a small learning curve with getting my head around Silverlight and XAML, but the reward is worth it because in the end I only needed to write script to build a XAML string and make method calls to Virtual Earth and Silverlight to do all of the heavy lifting.