Google Maps API Tutorial© 2007, 2008, 2009 Mike Williams |
Translate this page: |
Get Directions on your own mapIt is now possible to obtain directions on your own map.Here's an example. There are initially two links: "To here" and "From here". Clicking these links opens a corresponding form. The initial version of the info window, one with the "To here" form and one with the "From here" form. When the "To here" or "From here" link is clicked, the corresponding html string is loaded into the info window. When the "Get Directions" button is clicked, the form invokes the "getDirections()" function which makes a GDirections() call. The details of using GDirections() is well described in the Official Documentation, so I'll not repeat the information here. From v2.124 you can specify walking directions and avoid highways by using the options {travelMode:G_TRAVEL_MODE_WALKING} and {avoidHighways:true}. Potential Pitfalls
Here's an example of multi-point routing on your own map. |