I am trying to get the value of a getduration function into a marker
This is the function:
<code>
function getETA(from, toloc) {
if (GBrowserIsCompatible()) {
var wp = new Array ();
wp[0] = from;
wp[1] = toloc;
directions = new GDirections();
directions.loadFromWaypoints(wp);
GEvent.addListener(directions, "load", function() {
document.getElementById('results').innerHTML = directions.getDuration
().seconds/60 + " Minutes";
//ETAr= directions.getDuration ().seconds/60 + " Minutes";
//RETURN ETAr;
});
}
else {
alert("Sorry, the Google Maps API is not compatible with this
browser");
}
}
</code>
value returns fine into parent webpage but I am trying to introduce
the value of get duration into variable HTML to pass to the create
marker function
<code>
getETA("<%=fromx%>","<%=tox%>");
var marker = createMarker(point,html,markeropt)
map.addOverlay(marker);
</code>
I am at a loss. Please help
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" 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.