tags:

views:

113

answers:

2

Is there a way to use maps.google.com's get direction's functionality so that I can pass in the arguments for the directions from the url?

for example suppose I want google map to display the direction from new york city to baltimore, is there a way to pass it through the url in a way like this:

http://maps.google.com/map?from=new%20york%20%city&to=baltimore

Addition: I also want to know if it's possible to get directions for more than 2 places this way (for instance, from new york to baltimore and then to philadelphia)

A: 

You can use the following url parameters.

saddr for start address

daddr for destination address

The url would be http://maps.google.com/maps?saddr=new+york&daddr=baltimore

The values you pass in can be pretty much whatever you can type into the web app, ie names of places/lat longs/etc. Also, make sure you use a + character for spaces.

Nick Canzoneri
hey there, thanks for the info...I have another question: what if you want directions to more than 2 places....so for instance newyork to baltimore and then to philadelphia or any other arbitrary number of directions
kamikaze_pilot
Nick Canzoneri
A: 

Sure can.

Directions from ATL to LAX:

http://maps.google.com/maps?saddr=atl&daddr=lax

Updated:

Atlanta to LaGuardia to LA to Andrau Airpark...

http://maps.google.com/maps?source=s_d&saddr=ATL&daddr=LGA+to:LAX+to:AAP

no