Draw a bing card?

How can I draw on bing cards? Or I would like to add a marker. I found the coordinates, and now I want to display this place on the map with a marker ...

+3
source share
1 answer

To draw lines on a map, you use the element MapPolylineas a child of the control Map. To add a marker to a control Map, you add the element Pushpinas a child of the control Map. To add multiple elements (lines or buttons), add MapItemsControlas a child of the control Mapand specify ItemsSourceand ItemTemplate.

The following code example is displayed Pushpinto display the current location and MapItemsControlto display waypoints on a route:

<maps:Map x:Name="_map"
            CopyrightVisibility="Collapsed"
            CredentialsProvider="Your API Key Here"
            LogoVisibility="Collapsed">
    <maps:MapItemsControl ItemsSource="{Binding WayPoints}">
        <maps:MapItemsControl.ItemTemplate>
            <DataTemplate>
                <maps:Pushpin Background="{Binding BackgroundBrush}" Location="{Binding Location}"/>
            </DataTemplate>
        </maps:MapItemsControl.ItemTemplate>
    </maps:MapItemsControl>
    <maps:Pushpin x:Name="_current" Background="Blue" Location="{Binding CurrentLocation}"/>
</maps:Map>

This blog post can also help you get started.

+2
source

Source: https://habr.com/ru/post/1788137/


All Articles