These examples of arrays in V2
var lines = xmlDoc.documentElement.getElementsByTagName("line");
for (var a = 0; a < lines.length; a++) {
var colour = lines[a].getAttribute("colour");
var width = parseFloat(lines[a].getAttribute("width"));
var points = lines[a].getElementsByTagName("point");
var pts = [];
for (var i = 0; i < points.length; i++) {
pts[i] = new GLatLng(
parseFloat(points[i].getAttribute("lat")),
parseFloat(points[i].getAttribute("lng")));
}
var poly = new GPolyline(pts,colour,width);
map.addOverlay(poly);
gpolylines.push(poly);
}
how arrays in V3
why like this can not display the line?
var lines = xml.documentElement.getElementsByTagName("line");
for (var a = 0; a < lines.length; a++) {
var points = markers[a].getElementsByTagName("point");
var route = [];
for (var i = 0; i < points.length; i++) {
var routes = new google.maps.LatLng(
parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
route.push(routes);
}
var poly = new google.maps.Polyline({
map: map,
path: routes,
strokeColor: "#FF0000",
strokeWeight: 5,
strokeOpacity: 0.6
});
poly.setMap(map);
}
what's the probLem
thanks. .
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.