> Write the Adress on two fields and click on the Button. > It do Will the route because I´m using GDirections and know that I can´t use > GDirections !! > But what code that I can´t use for calculate the distance for straight line?
I presume that you actually do want the GDirections route, as well as the straight-line distance. If you didn't want the GDirections, you could just geocode the two points given by the webpage user, then use the methods already describedto find the distance between two lat/lngs. You could still do it that way with GDirections ; but as you're using GDirections you can save some geocoding by using some of the data from it, GDirections has already geocoded the start and end. You'd need to extract the latlng of the start and end, and do the straight line distance between those. There are clues as to how to go about that here - http://econym.org.uk/gmap/steps.htm in particular you'll be interested in route.getStep(i).getLatLng() --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
