Bing 地图 WPF 添加位置标记
Bing maps WPF add location markers
我的地图上有一个图钉,但是当我单击并拖动地图时,图钉停留在屏幕上的同一位置并且不随地图移动。如何将图钉放在特定位置(坐标)并让它留在那里?
这是我的 XAML 代码:
<Window x:Class="WPFKiosk.MapWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WPFKiosk"
mc:Ignorable="d"
Title="MapWindow" Height="910" Width="1080" WindowStyle="None" ResizeMode="NoResize">
<!-- -->
<Grid Width="1080" Height="915">
<!-- <Image HorizontalAlignment="Left" Height="644" Margin="20,64,-35,0" VerticalAlignment="Top" Width="1095" Source="Images/map.png"/> -->
<m:Map x:Name="myMap" CredentialsProvider="My_Key" Mode="Road"/>
<m:Pushpin Location="28,-81"
/>
<Image HorizontalAlignment="Left" Height="100" Margin="510,740,0,0" VerticalAlignment="Top" Width="100" Source="Images/iTO Back Arrow.png" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
</Grid>
</Window>
图钉不是 "on the map"。
它应该是这样的:
<m:Map x:Name="myMap" CredentialsProvider="My_Key" Mode="Road">
<m:Pushpin Location="28,-81"/>
</m:Map>
我的地图上有一个图钉,但是当我单击并拖动地图时,图钉停留在屏幕上的同一位置并且不随地图移动。如何将图钉放在特定位置(坐标)并让它留在那里? 这是我的 XAML 代码:
<Window x:Class="WPFKiosk.MapWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WPFKiosk"
mc:Ignorable="d"
Title="MapWindow" Height="910" Width="1080" WindowStyle="None" ResizeMode="NoResize">
<!-- -->
<Grid Width="1080" Height="915">
<!-- <Image HorizontalAlignment="Left" Height="644" Margin="20,64,-35,0" VerticalAlignment="Top" Width="1095" Source="Images/map.png"/> -->
<m:Map x:Name="myMap" CredentialsProvider="My_Key" Mode="Road"/>
<m:Pushpin Location="28,-81"
/>
<Image HorizontalAlignment="Left" Height="100" Margin="510,740,0,0" VerticalAlignment="Top" Width="100" Source="Images/iTO Back Arrow.png" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
</Grid>
</Window>
图钉不是 "on the map"。
它应该是这样的:
<m:Map x:Name="myMap" CredentialsProvider="My_Key" Mode="Road">
<m:Pushpin Location="28,-81"/>
</m:Map>