Folks, I am bit confused about how to assign an event to a polycluster
polygon.

I have an array of lon/lat like this:

var poly=
[{
"1":[[{x: -87.74829,y:41.99727},{x: -87.70935,y:41.99739},{x:
-87.67506,y:41.99793},{x: -87.674,y:41.96157},{x: -87.74754,y:
41.96072},{x: -87.74829,y:41.99727}]],
"2":[[{x: -87.74751,y:41.96071},{x: -87.67396,y:41.96154},{x:
-87.67329,y:41.93234},{x: -87.74658,y:41.93153},{x: -87.74751,y:
41.96071}]]
}];

I can draw the polycluster polygons with the following line:

cluster.setPaths(poly[0]);
cluster.setStyle(1,{fill:1,stroke:1,. . .});
cluster.setStyle(2,{fill:1,stroke:1,. . .});

How could I initialize a click event on these two polygons? I want an
info window to pop-up showing the name of the polygon when the user
clicks on it. Should it be something like?

cluster.setClick(myFunction(poly,1));

and then implement the function:

myFunction(p,t) {
“my code ”;
}

Right now “my code” is executed when the polygon is created. I want it
to be executed only when someone clicks on the polygon.

Appreciate any suggestions.

Thanks,

Abraham

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

Reply via email to