It should be pretty easy (distance in miles here, estimated duration
in minutes) obviously this code snippet doesn't work but the important
things are there.

var dirObj = new GDirections();
var loadStr = var loadStr = 'from: ' + from + ' to: ' + to;
dirObj.load(loadStr,{getPolyline:true,getSteps:true});
var distance = parseInt(dirObj.getDistance().meters / 1609);
var duration = parseFloat(dirObj.getDuration().seconds / 60).toFixed
(2);

Start with maybe Mike Williams' tutorial:
http://econym.org.uk/gmap/basic4.htm

The code above came (originally) from (Marcelo's page):
http://maps.forum.nu/gm_driving_radius.html

-Brian

On May 13, 3:48 pm, simonDev88 <[email protected]> wrote:
> Hey everyone.
>
> I'm a newbie to google maps/javascript (as some of you probably
> already know).
> Is it complicated to have 2 textboxes where you can enter to locations
> and it calculates a route and gives you the distance (in miles) just
> like the "get directions" on google maps.
>
> It needs to plan the route (although displaying the actual planned
> route isnt essential) I just need a very accurate distance in miles
> and not in a straight line.
>
> This is for a Taxi firm and they would like customers to be able to
> type in start and end location and get the miles (which in turn would
> calculate the rough cost for the trip)
>
> This is probably very complicated but is there a tutorial that makes
> it easy anywhere?
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to