Ticket #2595 (new feature)

Opened 3 years ago

Last modified 3 years ago

Optimize the route Functionality

Reported by: mayankparmar2000 Owned by:
Priority: minor Milestone: Future
Component: general Version: 2.9
Keywords: Cc:
State:

Description

I have list of addresses and now I want to find in whch order I need to set them so the driving time and cost will be minimum. I don't need the exact cost and time, but just need the api so that it can set the order of the list.

9001 Jenny Lind Road, Fort Smith, AR, United States - 1 2210 Fianna Oaks, Fort Smith, AR, United States - 2 7201 South 28th Street, Fort Smith, AR, United States - 3 7301 Rogers Avenue, Fort Smith, AR, United States - 4 1001 Towson Avenue, Fort Smith, AR, United States - 5 7700 U.S. 271, Fort Smith, AR, United States - 6 5701 Jenny Lind Road, Fort Smith, AR, United States - 7 4301 Regions Park Drive, Fort Smith, AR, United States - 8

Below is the code I had written to perform the same operation in MapPoint 2010. Is there any chance that I can have the similar functionality like rtAddress.Waypoints.Optimize() in OpenLayers.

Dim strStreet() As String = {"9001 Jenny Lind Road", _

"2210 Fianna Oaks", _ "7201 South 28th Street", _ "7301 Rogers Avenue", _ "1001 Towson Avenue", _ "7700 U.S. 271", _ "5701 Jenny Lind Road", _ "4301 Regions Park Drive", _

"9001 Jenny Lind Road"}

Dim strCity() As String = {"Fort Smith", _

"Fort Smith", _ "Fort Smith", _ "Fort Smith", _ "Fort Smith", _ "Fort Smith", _ "Fort Smith", _ "Fort Smith", _ "Fort Smith"}

Dim locAddress() As MapPoint.Location = {Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing} Dim ppAddress() As MapPoint.Pushpin = {Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing} Dim wpAddress() As MapPoint.Waypoint = {Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing} Dim rtAddress As MapPoint.Route For i As Integer = 0 To 8

oFindResults = oMap.FindAddressResults(strStreet(i), strCity(i), , "AR", , MapPoint.GeoCountry.geoCountryUnitedStates) '.Item(1) locAddress(i) = oFindResults(1) 'locAddress(i).GoTo() 'ppAddress(i) = oMap.AddPushpin(AtLocation:=locAddress(i), Name:=strStreet(i)) 'ppAddress(i).BalloonState = MapPoint.GeoBalloonState.geoDisplayBalloon rtAddress = oMap.ActiveRoute wpAddress(i) = rtAddress.Waypoints.Add(Anchor:=locAddress(i))

Next rtAddress.Waypoints.Optimize() rtAddress.Calculate()

Regards,

Change History

Changed 3 years ago by fredj

  • milestone changed from 2.10 Release to Future
Note: See TracTickets for help on using tickets.