Also I wanted to wrap up various types of maps in a simple to use control. I got the tile sources from here
http://pietschsoft.com/post/2010/06/14/Display_Google_Maps_Imagery_using_Bing_Maps_Silverlight_Control.aspx
I just had to update the Satellite view to the latest version since the khm source no longer works.
I made a UserControl out of it. Shared it here : (SourceCode) http://code.google.com/p/mvvmslmaps/downloads/list
In Action:
Lessons Learned
Just one: I add a MapItemsLayer to the maps in my application so I wanted to redirect the Content Property of the custom UserControl to the Content Property of my bing maps instance.
It was super easy to do :
- Added the attribute : [ContentProperty("Children")] to your Control.
- Added the following as a property :
{
get { return MyMap.Children; }
}
This means that when I add a MapItemsControl :
<Control:MVVMMapControl x:Name="MyMap"> <m:MapItemsControl x:Name="ListOfItems" ItemsSource="{Binding Sites}" ItemTemplate="{StaticResource CellTemplate}" ></m:MapItemsControl> </Control:MVVMMapControl>
It gets added as a child of my bing maps instance.
No comments:
Post a Comment