Draw on bing maps?
How can I draw on bing m开发者_JS百科aps? Or actually I'd like to add a marker. I have detected coordinates and now I want to display this place on a map with a marker...
To draw lines on a map you use the MapPolyline
element as a child of the Map
control. To add a marker to the Map
control, you add a Pushpin
element as a child of the Map
control. To add multiple items (lines or pushpins) you add a MapItemsControl
as a child of the Map
control and specify the ItemsSource
and ItemTemplate
.
The following code example shows a PushPin
to display the current location, and a MapItemsControl
to show 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 may also help you get started.
精彩评论