Hello
I hope this is the right place to solve a problem with closing an
event-opened info window.

Let me explain this as clearly as I can :

- I got a map with a listener that opens an info window on click. (A)
- I got a drop down menu that creates another infowindow and opens it
on the same map (B).
When I click on the map I get all info windows closed but when I have
a clicked info window that is on the map, when I choose a value from
the drop down the clicked info windows does not disappear... For sure
this must be an easy thing to solde, but I can't find out what I
should do...

(A)
In the initialize() i got this :
<code>
google.maps.event.addListener(layer, 'click', function(e) {
    customInfoWindow(e);
  });
</code>

The customInfoWindow function is :
<code>
function customInfoWindow(event) {
    var buf = event.row['cnt'].value;  // value from Fusion Table
    var content = "<div>Window content for " + buf + "</div>"; //
content generation
   // let's close the drop down opened info window if any, called
InfoWindow it is a google.maps.InfoWindow
   if (infoWindow) { infoWindow.close();}
    event.infoWindowHtml = content;
}
</code>

When I click on the map everything goes fine. Previous info window
disappears and new infowindow is displayed



(B)
This is the code to open the info window on drop-down change. It works
fine too but does not close the event infowindow and I cannot find how
it should be done... no event.close() or event.InfowWindow.close() or
whatever. I spent some time on it... Any help would be.... helpful

<code>
if (!infoWindow) infoWindow = new google.maps.InfoWindow({});
   infoWindow.setOptions({
      content: contentInfos,
      pixelOffset: new google.maps.Size(0, 2),
      position: position
    });
    infoWindow.open(map);
</code>

Thanks
Louis

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