Okay you have a very good point, it makes sense now.

So I modified my xml file slightly to this type of format:
<datapoints>
 <line width="5">
   <point lat="43.65654" lng="-79.90138" />
   <point lat="43.91892" lng="-78.89231" />
   .
 </line>
 <line width="5">
   <point lat="43.9078" lng="-79.0264" />
   <point lat="44.1037" lng="-79.6294" />
   .
   .
 </line>
 <line width="5">
   <point lat="43.9080" lng="-79.0284" />
   <point lat="44.1080" lng="-79.6284" />
   .
   .
 </line>
</datapoints>

So now it "should" be able to recognise the multiple lines and not
overwrite the previous "lines" like the previous function this. I've
also updated that
processPolyLines(colour) function to this (removing the unwanted
loops):

function processPolyLines(colour) {
        alert("The value of the argument colour is " + colour); // This works
perfecty
        var xmlDoc = GXml.parse(request.responseText);
        alert("Status is " + request.status);

                var lines = xmlDoc.documentElement.getElementsByTagName("line");
                alert("The length of lines is " + lines.length); // This 
returns a
"lines" value of zero, when it should return 12.
                for
                ( var a = 0; a < line.length; a++) {
                        var width = parseFloat(line[a].getAttribute("width"));
                        var points = line[a].getElementsByTagName("point");
                        var pts = [];
                        for (var i = 0; i < points.length; i++) {
                                alert(points.length);
                                pts[i] = new GLatLng(parseFloat(points[i]
                                                .getAttribute("latPoly")), 
parseFloat(points[i]
                                                .getAttribute("longPoly")));
                        }
                        p[a] = new GPolyline(pts,colour,width)
                        map.addOverlay(p[a]);
}

However that "alert statement" which I put up:
alert("The length of lines is " + lines.length);

It returns that the length of "lines" is 0 when it should be 12.
Actually even when I comment out the entire "for loop" I am still
getting the same issue. Am I missing something here?

Thanks Rossko for all your help and everyone else as well who gave
sound advice.

-- 
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.

Reply via email to