I'm trying to load directions for some lat/lng points that a user
selects. My map loads fine the the array is properly built for the
waypoints, but I don't think it is in the correct format. Nothing
ends up loading in the directionsPanel and the map is not updated with
the directions.
This is returned by alert(dArray) after 2 points are sent to
buildarray:
-85.76241,38.218764,-85.68326,38.22292
I think I need it to look like this though:
"-85.76241,38.218764", "-85.68326,38.22292"
Any ideas?
Short code:
var dn = 0;
var dArray = new Array();
function buildarray(lat, lng){
var point1 = lat + "," + lng;
dArray[dn] = point1;
dn = dn + 1;
}
function displayDirections(){
directions = new GDirections(map, directionsPanel);
directions.loadFromWaypoints(dArray);
alert(dArray);
}
--
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=.