microsoft / BingMapsRESTToolkit

This is a portable class library which makes it easy to access the Bing Maps REST services from .NET.

Home Page:https://github.com/Microsoft/BingMapsRESTToolkit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go back route

testcszarp opened this issue · comments

I have list of 3 waypoints.

var routeRequest = new RouteRequest()
{
Waypoints = [listOfWaypoints],

            //Specify that we want the route to be optimized.
            WaypointOptimization = BingMapsRESTToolkit.Extensions.TspOptimizationType.TravelDistance,
            RouteOptions = new RouteOptions()
            {
                Optimize = RouteOptimizationType.Distance,
                TravelMode = TravelModeType.Driving,
                RouteAttributes = new List<RouteAttributeType>()
                    {
                        RouteAttributeType.RoutePath,
                        RouteAttributeType.ExcludeItinerary,
                    }
            },
            //When straight line distances are used, the distance matrix API is not used, so a session key can be used.
            BingMapsKey = "key"
        };

when I execute this the route look like this
FROM POINT 1 TO POINT 2, FROM 2 TO POINT 3 AND FROM 3 TO POINT 1.
How I can get route only from 1 to 3 via 2, I dont need a go back route

I have the same issue which makes the waypoint optimization practically useless. Adding the start point automatically as the end point impacts the total driving distance and time. Are there any plans to fix this issue?

Has to be an option on RouteOptions, because for my case, I need to have the start point as the end point as well.
Thanks

Set the IsViaPoint property of Waypoint 2 to true.