multidestgmap_20070628_2.jpg

The ability to create multiple-hop routes was recently added to Google Maps. Not only does this let you plan a trip to New York by way of San Francisco and Tampa Florida, but you can also use the feature to adjust a more conventional route. You might do this to manually avoid road construction or traffic jams that you know about.

To use the feature, you simply drag a point on the blue line to another position. The map will automatically compute a new route that crosses through the new position.

You can make use of this functionality from the standard map APIs as well. Before, start and destination addresses were specified by the saddr and daddr parameters:

http://maps.google.com/maps?saddr=start+address&daddr=destination+address

With multiple hops, you just encode all the hops into the destination address, seperated by “to:”. For example, “destination1 to:destination2 to:final destination”:

http://maps.google.com/maps?
saddr=minneapolis%2C+mn& daddr=san+francisco%2C+ca+
to%3Atampa%2C+fl+
to%3Anew+york%2C+new+york

Link.