Hi, i want to get distances and duration of routes to one point.
And then order them in one array by total distance and total time....
now i'm new to google api and javascript.... and i wrote this:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
<title>Google Maps JavaScript API Example: get total distance and
time</title>
<script src="
http://maps.google.com/?file=api&v=2.x&key=ABQIAAAAY5W_vRWuswTbpb3VAZ5RXRRAWceEk7thq0iLOlO9MAe9N94jBBTnAmgYAXuIq7f6KWVppCtBFlUS6A"
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
gdir = new GDirections();
GEvent.addListener(gdir, "load", onGDirectionsLoad);
}
function onGDirectionsLoad(){
window.alert (gdir.getDistance().meters + " metri")
window.alert (gdir.getDuration().seconds + " secondi")
metri = gdir.getDistance().meters
}
function distanza() {
partenza = "Milano";
arrivo = "Roma";
gdir.load("from: " + partenza + " to: " + arrivo, { "locale":
"it" });
}
</script>
</head>
<body onload="initialize();distanza();" onunload="GUnload()">
</body>
</html>
this is functoning and gives me time and meters.. but how can i
reiterate this? thanks...
mirko
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---