You need to stop propagation of the click event onto the map.

Try something like this:

Infobox.prototype.initialize = function( map ) {
  var that = this;
  this.map = map;
  this.container = document.createElement("div");
  this.container.id = 'infobox';
// ...
  map.getPane(G_MAP_FLOAT_PANE).appendChild(this.container);

  this.container.onclick = function(ev) {
    try{ev.stopPropagation()}catch(e){event.cancelBubble=true};
    alert('infowindow clicked')
//    var clickedInfoWindow = this;
//    Your code ....
  };

// ... etc

--
Marcelo - http://maps.forum.nu
--




On Oct 24, 1:58 pm, "Stefan Sturm" <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> I made e little example to show this problem:http://demo.tripplanner.de
>
> This shows a map with some markers. Just click one marker to open the
> infowindow.
> Now click inside the infowindow and see, that the infowindow gets
> closed. And the firebug console only show the entry "map click".
> But it should show "div click"...
>
> The two Event listener still exists.
>
> > // div listener
> > GEvent.addDomListener( div, "click", function() {
> >        console.log( 'div click' );
> > });
>
> > map listener
> > GEvent.addListener( map, "click", function() {
> >        console.log( 'map click' );
> > });
>
> Here are the two javascript files where everything about the map 
> happens:http://demo.tripplanner.de/scripts/tripplanner/googleMaps.jshttp://demo.tripplanner.de/scripts/infobox.js
>
> Hope somebody can help me on this :-)
>
> Greetings,
> Stefan Sturm
--~--~---------~--~----~------------~-------~--~----~
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