> which all works on my understading that this bit: for (var i=0;
> i<pts.length-1; i++) {  is what makes the loop.

Yep.
You have to use the loop variable 'i' carefully though, and think
about what you are telling the code to do.
Looking at the 'show' part of the business, what you would _like_ to
do is step through all the markers held in 'pts'.
Test each marker in turn to see if it is associated with this
particular polyline.
Then 'show' it if it is associated.

What your code actually looks like is
   for (var i=0; i<pts.length-1; i++) {
          if (pts[i].mypoly_num == poly_num) {
               pts[poly_num].show();
           }
    }
and it does this ;
Steps through all the markers held in 'pts' using 'i' as the index -
good.
Checks the current marker pts[i] to see if it is one that is wanted -
good.
If it is, it then goes on to show some other random marker
pts[poly_num] instead of the one you actually tested pts[i] - bad.

The code in the 'hide' part is different again, looks half finished to
me.

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