Moving to Silverlight Maps

Tags: Bing, Map, Silverlight, OpenStreetMaps

As I have written about previously I have made a decision to move on from AJAX map applications and start working with Silverlight. I have chosen to go with the Silverlight Map Control from Microsoft. The control is still CTP, but it does seem fully functional. There are some things features missing, and the access to the full Silverlight UI engine means that while you can do whatever you want, you have to code most of it yourself.

The price to be paid for moving to Silverlight is that you can't use Google as a map supplier. As for Microsoft, then I can't get a full understanding of the license terms to use their map tiles. Since the map control allows custom tiles, I decided to load them from OpenStreetMaps. They let you use them for free, but I'm sure they won't mind a donation.

One of the first features I felt was missing, was the way overlays were handled. In the Reimers.Silverlight library you can find the OverlayCollection class, that acts as an intermediate layer between your application and the map.It does this mainly by defining several overlay layers to ensure that large overlays do not cover smaller ones, even though they are added later (i.e. have a higher z-index). It helps you define the properties for the overlays. Map overlays rely on a number of attached properties which are probably not the first thing you learnt when started on Silverlight.

Another missing feature was KML support. KML is now the standard for serializing and exchanging geographic information. The Reimers.Silverlight library allows you to read and write KML information through the OverlayCollection class. To fully support KML data, I had to define the KmlOptions class which holds the default overlay information and can be attached to any DependencyObject. Further there is the KmlStyle class that stores style information from a KML definition and can attach the relevant Silverlight styles to the DependencyObject.

Last, but not least, the assembly also includes access to geocoding, reverse geocoding and routing operations from public sources through the Services class. Microsoft offers the same operations for pay, these operations are offered for free.

Latest Tweets