At creation, your polys are saved into two global arrays, gpolylines[]
and gpolygons[]

createPolyline() saves into gpolylines[] under the control of global
variable 'a', which starts at zero and is incremented for each
polyline.

There's a createPolygon() function, which saves into gpolygons[] under
the control of global variable 'k', which starts at zero and is
incremented for each polygon.

Then there's a createClickablePolygon() function , which gets defined
inside your XML processing code, and inside the polygon loop.  A new
identical function is created for every poly that gets processed in
the loop, I've no idea why you would want to do that.

There's an extraneous
    gpolygons.push(shape);
in your XML processing code, which adds another copy of the poly to
the end of the array.  That doesn't matter in most cases, since it
will get overwritten by the following poly under the control of
'k' ... but you will end up with two copies of the last one.

So after setting up, you have
    gpolylines[0] to gpolylines[2]   and also
    gpolygons[0] to gpolygons[11]

When your handleSelected() runs with an index of say, 1, it will act
on both gpolylines[1] and gpolygons[1], exactly as you describe

You might instead store all your polys in a common array, with a
common index.

You might find it useful to print your scripts out, and work through
them literally following the action with a finger.  It sounds dumb but
this is basically what the browser does!

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