0

I am very new to Bing Maps Concept

Requirement: Need to Design a Bing Map with Custom Pushpin and many layers on the Bing Map Work Done: Created a Bing map with a Key and 2 DLL's, Added multiple Pushpins, Added a shape on the map using MapPolygon

Issues:

  1. I need to add Custom Pushpins to the Bing Map(I have an Image in my Project folder which I need to show on the Bing Map when the Location is specified). I have gone through many links and none worked for me. So plz tell me the method to follow to show the Custom Pushpin on the Bing Map.

  2. I need to add multiple layers on the Bing Maps and I have least knowledge about it. So please guide me about the Layering Concept in Silverlight Bing Maps.

Badly need help :(

1 Answers1

0

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

It seems that you need only place a MapLayer and place Pushpin controls in it. You use the MapLayer.Position attached property to pin down anything within that map layer to the map; so that when the user moves the map it says. This attached property is of the type Location which is a type that is proprietary to the Bing Map control that contains both a Longitude (double) and a Latitude (double) value. If you need to bind a collection of said locations than you can use a MapItemsControl inside of a MapLayer bind its ItemsSource property to your collections. You can also create data template; just remember that your template root must use the MapLayer.Position attached property to specify its location on the map. This can be bound to any Location-typed 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>
Jordan
  • 9,642
  • 10
  • 71
  • 141