Monday, 22 October 2007

Silverlight 1.0 experiences

I have been spending the last week working on converting a web application from an image based web application to a Silverlight 1.0 application.

The application is a campus map web app which you can zoom, pan, select regions, show/hide layers, and source information.

With the exiting application, to maintain high quality plans when the plan was zoomed, a region selected/deselected or layer shown/hidden a new image would be loaded. This can end up with quite a large amount of data transferred fro basic use of the application.

With the use of Silverlight 1.0 I am able to download the geometry of the plans once, then use JavaScript to highlight regions when selected, and show/hide layers, and zoom (using scale transform) without the need to download any more data. For a particular plan once it it downloaded the only transfer you need to do is any data you want to retrieve in relation the plan or region selected. This can be achieved with web services.

One issue I have been having is trying to zoom in on the center of the currently viewable area, then still being able to pan. You can easily zoom the center with the zoom transform, use the ScaleX and ScaleY set to the scale, and CenterX and CenterY set to the center of the view area. If anyone has any ideas on how to compete this effectively, I would like to hear from you.

Another feature which is lacking in Silverlight 1.0 is integrated textbox, the easiest way to add a textbox to your Silverlight 1.0 is to overlay HTML. This is achieved by floating a div over the Silverlight control and setting the Silverlight control to not window contained (as I recall from memory).

Overall Silverlight 1.0 has been an interesting platform to develop with. Woks great with both IE7 and Firefox 2 on Vista Ultimate, but Silverlight does not appear to work with Opera at this time, don't know if support will be added or not.