Try this link it might help:
http://www.easypagez.com/maps/directions.html
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Google Maps JavaScript API v3" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-maps-js-api-v3/-/7l22EQhCziIJ.
> To post to this group, send email to
> google-map...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-maps-js-a...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
| function createMarker(point,map,infoWindow,html,name) { | |
| var marker = new google.maps.Marker({position:point,map:map,title:name}); | |
| var i = gmarkers.length; | |
| to_htmls[i] = html + '<br>Directions: <b>To here<\/b> - <a href="javascript:fromhere(' + i + ')">From here<\/a>' + | |
| '<br>Start address:<form action="javascript:getDirections()">' + | |
| '<input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="" /><br>' + | |
| '<INPUT value="Get Directions" TYPE="SUBMIT"><br>' + | |
| 'Walk <input type="checkbox" name="walk" id="walk" /> Avoid Highways <input type="checkbox" name="highways" id="highways" />' + | |
| '<input type="hidden" id="daddr" value="'+ point.lat() + ',' + point.lng() + | |
| '"/>'; | |
| from_htmls[i] = html + '<br>Directions: <a href="javascript:tohere(' + i + ')">To here<\/a> - <b>From here<\/b>' + | |
| '<br>End address:<form action="javascript:getDirections()">' + | |
| '<input type="text" SIZE=40 MAXLENGTH=40 name="daddr" id="daddr" value="" /><br>' + | |
| '<INPUT value="Get Directions" TYPE="SUBMIT"><br>' + | |
| 'Walk <input type="checkbox" name="walk" id="walk" /> Avoid Highways <input type="checkbox" name="highways" id="highways" />' + | |
| '<input type="hidden" id="saddr" value="'+ point.lat() + ',' + point.lng() + | |
| '"/>'; | |
| html = html + '<br>Directions: <a href="javascript:tohere('+i+')">To here<\/a> - <a href="javascript:fromhere('+i+')">From here<\/a>'; |