The block of code I have in the 2nd "for loop" is:
p[a] = new GPolyline(pts,colour,width)
map.addOverlay(p[a]);

The variable "a" represents a particular line, if "a" were 3 then I'm
interested in points relating to line[3], which would be all the
coordinates for 'lineTFT004.'

Now the line below which is in the very last function (included in the
top post) is:
p[lineIndex].setStrokeStyle({color: col});

The p[lineIndex] in here represents the p[a] which I've shown above.
Since I can pass any value to "lineIndex" via the arguments and also
since I can pass any colour value it should technically change
whatever segment of the road I wish to that particular colour. An
example is:

changeColors(3, "FF0000");

If I do this then it means that "lineIndex" takes the value of 3 hence
my original p[a] should now be p[3] and all the coordinates relating
to p[3] (it should be lineTFT004), I will have full control of to
change that segments' colour.

But now since "lines" is destroyed each time hence my message boxes
are only showing 1,1,1,1 etc... I will not be able to do what I intend
to - thus the only segment I can ever colour and control with my
changeColors() function is a lineIndex of 0, which would be p[0]. Now
this explains why any other lineIndex value other than 0 are not
colouring their respective segment on the road.

So any ideas please on how I can resolve this? I am making full use of
the debugging capabilities I have in firefox,chrome and IE to help me
get through this but really could use some professional advice here.

Thanks,

PS: I've changed the format of my XML to match what Rossko suggested.

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