0

在我的 WP7.5 应用程序中,用户可以导航到大学。他可以在地图上看到他通过扫描二维码获得的初始位置。地图图像是画布背景。一旦他选择了 X 和 Y 坐标已知的目的地,我如何在地图上绘制从用户当前位置到目的地的路线?我不知道这是否可能。

这是允许在地图上显示用户的起始位置的工作代码。

public void MarkLocation(ImageBrush imgmap, int posizioneX, int posizioneY)
    {
        Canvas.Background = imgmap;
        Image imgmarker = new Image();
        imgmarker.Source = new BitmapImage(new Uri("Images/marker.png", UriKind.Relative));

        Canvas.SetLeft(imgmarker, posizioneX);
        Canvas.SetTop(imgmarker, posizioneY);
        Canvas.Children.Add(imgmarker);                  

    } 

我希望你能帮帮我!提前致谢。

4

1 回答 1

1

如果您使用BingMapsDirectionsTask(在 WP7 中)或MapsDirectionsTask(在 WP8 中),用户将获得完整的导航体验,包括显示路线,您无需担心动态生成图像或在地图控件上叠加项目。

于 2013-02-27T12:56:14.110 回答