-1

I am working with Google Maps API V3 to calculate all the possible routes from a given Source to the specified Destination. For this I takes the Destination and Source as inputs from the user and pass these values in the request with option provideRouteAlternatives: true. I am successful in calculating different Routes and also marking i.e. displaying them on my Map.

Now I am wondering if it is possible to name the Different Routes. By naming the Routes I mean adding a small description to each Route like the Street Name etc. which that particular route takes while moving from Source to Destination. I want to do this so as to make it look more interactive. For example if there are 3 Routes possible from location A (Arizona Street, San Diego, CA, USA) to location B (Fenton Parkway, San Diego, CA 92108, USA) then instead of showing results like Route 1, Route 2, Route 3 it should show the Street names like "Texas St & Rio San Diego Dr", "Texas St & Friar Rd", "Friars Rd".

I am able to calculate all the other things like the trip distance and total trip time for each of my Route but have no clue to how to add this description to each of my Route.

Any help will be appreciated.

Thanks

user2004685
  • 9,548
  • 5
  • 37
  • 54

2 Answers2

0

That is what appears in the panel if you provide one:

Suggested routes:
Texas St and Rio San Diego Dr 2.6 mi - about 9 mins
Texas St and Friars Rd 3.3 mi - about 10 mins
Friars Rd 4.8 mi - about 11 mins

example

geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • Exactly...But I want these results to be added into a ListBox as I am not displaying the Panel. So is there any way to access these using JavaScript? – user2004685 Jan 25 '13 at 14:57
0

Try using summary from the returned result. From the Google Maps API:

summary contains a short textual description for the route, suitable for naming and disambiguating the route from alternatives.

Tim Shedor
  • 165
  • 1
  • 7