Adding a Custom Pushpin to Bing Maps in Silverlight

I am very new to Bing Maps concept

Requirement: you need to create a Bing map using Custom Pushpin and many layers on the Bing Map. Work done: created a Bing map with a key and two DLLs, added a multiple button, added a form on the map using MapPolygon

Questions:

  • I need to add custom Pushpins to the Bing map (I have an image in the Project folder that I need to show on the Bing map when the location is specified). I went through many links and no one worked for me. So plz tell me how to follow to show Custom Pushpin on Bing map.

  • I need to add some layers on Bing Maps, and I have the least knowledge about it. So please tell me about the Layering concept in Silverlight Bing Maps.

Need help badly :(

0
source share
1 answer

Have you tried the interactive SDK that Microsoft provides? It helps me.

It seems you only need to place the MapLayer and place the Pushpin controls in Pushpin . You use the attached MapLayer.Position property to bind something to this map layer to the map; so when the user moves the map, she says. This attached property is of type Location , which is a type that is the property of the Bing Map control, which contains both the longitude (double) and the Latitude (double) value. If you need to associate a collection of specified locations, you can use the MapItemsControl inside MapLayer to associate your ItemsSource property with your collections. You can also create a data template; just remember that your template root should use the MapLayer.Position property to indicate its location on the map. This can be associated with any Location value.

  <UserControl x:Class="MapControlInteractiveSdk.Tutorials.DataBinding.TutorialMapItemsControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:t="clr-namespace:MapControlInteractiveSdk.Tutorials.DataBinding" xmlns:m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"> <UserControl.Resources> <DataTemplate x:Key="LogoTemplate"> <!-- This doesn't have to be a pushpin control - it can be anything just apply the "m:MapLayer.Position" property to whatever is the root of the template. --> <m:Pushpin m:MapLayer.Position="{Binding Location}" /> </DataTemplate> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="White"> <m:Map CredentialsProvider="Your Key"> <m:MapLayer> <m:MapItemsControl x:Name="ListOfItems" ItemTemplate="{StaticResource LogoTemplate}" ItemsSource="{Binding MyLocalizedEntities}"> </m:MapItemsControl> </m:MapLayer> <m:MapLayer> <!-- You can have content in multiple layers: Latter layers are infront of former ones. --> </m:MapLayer> </m:Map> </Grid> </UserControl> 
0
source

All Articles