On Sep 7, 9:17 pm, ss ss <[email protected]> wrote:

> If I would like to have the infowindow open into the
> center of the polygon what will be calcuation be? Another thing is that how
> can I control if the person close the inforwindow by pressing the "x" I want
> then my polygon to be clear too? Thank you.

Don't be afraid to look at the documentation occasionally.

GPolygon has a method getBounds(), which returns a GLatLngBounds
object. GLatLngBounds has getCenter(). You can chain the methods
together: polygon.getBounds().getCenter()

There's also an infowindowclose event (on the map), so you can get its
handler to do whatever you want, including removing an overlay if
that's what is required. Remember to keep a reference to your polygon
so you know what to remove; and that reference will almost certainly
have to be global because it needs to be set outside the handler
function but used within it.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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