Google Maps API Tutorial© 2007 Mike Williams |
Get Directions on your own mapIt is now possible to obtain directions on your own map.Here's an example. I've tried to make the "Get Directions" option look as much like the one in the info window of the real Google page as possible. 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. Potential Pitfalls
Here's an example of multi-point routing on your own map. |