Windows phone 7 在Bing地图控件上计算和绘制路线
在我的WP7(芒果)应用程序中,我需要将用户从一个点导航到另一个点。我知道有一个地图控件可以让你在上面画职员,但是你怎么让它为你画路径呢?(基于指定的目的地和用户的当前位置-但这一直在变化,因此,如果用户中途离开,如何更新路线?要使用用户的当前位置更新地图,请使用Windows phone 7 在Bing地图控件上计算和绘制路线,windows-phone-7,windows-phone-7.1,bing-maps,Windows Phone 7,Windows Phone 7.1,Bing Maps,在我的WP7(芒果)应用程序中,我需要将用户从一个点导航到另一个点。我知道有一个地图控件可以让你在上面画职员,但是你怎么让它为你画路径呢?(基于指定的目的地和用户的当前位置-但这一直在变化,因此,如果用户中途离开,如何更新路线?要使用用户的当前位置更新地图,请使用地理坐标追踪器并在数据绑定图钉发生变化时更新其位置。请记住将最小距离设置为较低的值,例如5米 可以使用以下XAML模板创建类似bing地图上的图钉: <maps:Pushpin Background="{StaticResourc
地理坐标追踪器
并在数据绑定图钉发生变化时更新其位置。请记住将最小距离设置为较低的值,例如5米
可以使用以下XAML模板创建类似bing地图上的图钉:
<maps:Pushpin Background="{StaticResource PushpinLocationBrush}"
Location="{Binding MyLocation}">
<maps:Pushpin.Template>
<ControlTemplate>
<Grid>
<Rectangle Width="15"
Height="15"
Margin="0"
Fill="Black">
<Rectangle.Projection>
<PlaneProjection CenterOfRotationX="0"
LocalOffsetX="-2"
LocalOffsetY="5"
RotationZ="45" />
</Rectangle.Projection>
</Rectangle>
<Ellipse Width="7"
Height="7"
Margin="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Fill="Orange"
RenderTransformOrigin="0.339,0.232"
StrokeThickness="0" />
</Grid>
</ControlTemplate>
</maps:Pushpin.Template>
</maps:Pushpin>
相关XAML:
<maps:Map x:Name="RouteBingMap"
AnimationLevel="None"
CopyrightVisibility="Collapsed"
CredentialsProvider="YOURBINGMAPSKEYHERE"
LogoVisibility="Collapsed"
ZoomBarVisibility="Collapsed"
ZoomLevel="12">
<maps:MapLayer x:Name="RouteLayer" />
</maps:Map>
在这里,你基本上一次问了3个问题。下次,问一个详细的问题,这样你可以得到一个更简洁的答案。
<maps:Map x:Name="RouteBingMap"
AnimationLevel="None"
CopyrightVisibility="Collapsed"
CredentialsProvider="YOURBINGMAPSKEYHERE"
LogoVisibility="Collapsed"
ZoomBarVisibility="Collapsed"
ZoomLevel="12">
<maps:MapLayer x:Name="RouteLayer" />
</maps:Map>