You need to add an event handler for the close event of the info window.
It is done like GEvent.addListener(map, "click", function() {});
Except in your case you will want the infowindow you create and the close
event. Then you include your onCloseFn function.
If you need more help ask and we can provide more details.
On Wed, Sep 8, 2010 at 3:04 PM, ss ss <[email protected]> wrote:
> Dear Andrew,
> I have done like below but when I close it does not
> trigger the onCloseFn function?
> map.openInfoWindow(latlng,htmlString,onCloseFn);
>
> function onCloseFn() {
> alert('Closing');
> //map.recenterOrPanToLatLng(mblcPoint); // my center Point
> }
> On Wed, Sep 8, 2010 at 4:33 AM, Andrew Leach <[email protected]>wrote:
>
>> 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]<google-maps-api%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-maps-api?hl=en.
>>
>>
> --
> 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]<google-maps-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-api?hl=en.
>
--
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.