0

So I have a Bing Map control, a GeoCordWatcher getting gps lat and lon, a timer for position intervals and a RouteQuery maker turning the GPS cords into a path for the map.

The points are correct, +- a couple of meters. The problem is that if I am near an intersection or a side street it when the route query runs it takes me off on a half mile expedition that I never went on.

I have tried using both default accuracy and high accuracy but I get the same results. Actually seems to be worse with high accuracy.

Has anyone else had this issue?

            RouteQuery rq = new RouteQuery();
            List<GeoCoordinate> cords = new List<GeoCoordinate>();
            foreach (classes.PositionObj posObj in waypoints)
            {
                cords.Add(new GeoCoordinate(Convert.ToDouble(posObj.Lattitude), Convert.ToDouble(posObj.Longitude)));
            }
            rq.Waypoints = cords;
            rq.QueryCompleted += rw_QueryCompleted;
            rq.QueryAsync();


    void rw_QueryCompleted(object sender, QueryCompletedEventArgs<Route> e)
    {
        try { 
            if (e.Error == null)
            {
                Route myroute = e.Result;                
                mapRoute = new MapRoute(myroute);
                mapRoute.Color = (Color)Application.Current.Resources["PhoneAccentColor"];
                myMap.AddRoute(mapRoute);          
            }
        }
        catch (Exception error) { MessageBox.Show(error.Message); MessageBox.Show(error.StackTrace); leaveFeedback(error.StackTrace); }
    }
4

2 回答 2

0

试试代码:

routeQuery.TravelMode = TravelMode.Driving; 
于 2015-04-03T00:21:51.897 回答
0

我还没有能够测试它,但我认为这是我正在寻找的答案。

 rq.RouteOptimization = RouteOptimization.MinimizeDistance;

这是我找到的文档

http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.maps.services.routeoptimization(v=vs.105).aspx

http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.maps.services.routequery(v=vs.105).aspx

于 2013-08-08T15:11:40.980 回答