cybersthang / gmaps-utility-library-dev

Automatically exported from code.google.com/p/gmaps-utility-library-dev
0 stars 0 forks source link

Marker's listeners on events 'extinfowindowclose' and 'extinfowindowbeforeclose' aren't called #66

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create marker;
2. add listener to marker on event 'click' to open extinfowindow: smaple 
GEvent.addListener(marker, 'click', function() {
this.openExtInfoWindow(...); //configure window to be able to be closed;
});
3. add listener to marker on event 'extinfowindowclose': sample 
GEvent.addListener(marker, 'extinfowindowclose', function() 
{alert('close');});

What is the expected output? What do you see instead?
Expected output: alert window with text 'close';
Real output: nothing

What version of the product are you using? On what operating system?
version: 1.0
OS: winxp

Please provide any additional information below.
I fixed it in such way -> modify method: 
ExtInfoWindow.prototype.remove = function() {
  if (this.map_.getExtInfoWindow() != null) {
    GEvent.trigger(this.map_, 'extinfowindowbeforeclose');
//start of added code -- part 1
    if(this.marker_) {
        GEvent.trigger(this.marker_, 'extinfowindowbeforeclose');   
    }
//end of added code -- part 1
    GEvent.clearInstanceListeners(this.container_);
    if (this.container_.outerHTML) {
      this.container_.outerHTML = ''; //prevent pseudo-leak in IE
    }
    if (this.container_.parentNode) {
      this.container_.parentNode.removeChild(this.container_);
    }
    this.container_ = null;
//start of added code -- part 2
    if(this.marker_) {
        GEvent.trigger(this.marker_, 'extinfowindowclose');
    }
//end of added code -- part 2
    GEvent.trigger(this.map_, 'extinfowindowclose');
    this.map_.setExtInfoWindow_(null);
  }
};

Original issue reported on code.google.com by abab...@gmail.com on 16 Sep 2008 at 7:02

GoogleCodeExporter commented 8 years ago

Original comment by pamela.fox on 30 Sep 2008 at 9:05

GoogleCodeExporter commented 8 years ago
I just patched extinfowindow.js with the modifications that ababiuk suggested, 
and
confirm that GMarker now emits an "extinfowindow" event when its ExtInfoWindow 
is closed.

I tested this in Mac OS 10.5.5 with the following browsers:
Firefox 3.0.3
Safari 3.1.2
Opera 9.62

Original comment by npwhoff...@gmail.com on 2 Nov 2008 at 8:24

GoogleCodeExporter commented 8 years ago
Can you attach the diff to this bug?

Original comment by pamela.fox on 11 Nov 2008 at 4:24

GoogleCodeExporter commented 8 years ago
G'day Pamela. I've attached the diff to this comment. Apologies for the delay in
doing so.

Cheers,
Nick

Original comment by npwhoff...@gmail.com on 9 Dec 2008 at 3:02

Attachments:

GoogleCodeExporter commented 8 years ago
Thank you It wors better !

Original comment by jip...@gmail.com on 21 Dec 2008 at 2:46

GoogleCodeExporter commented 8 years ago
Thanks, patched in r852.

Original comment by pamela.fox on 28 Dec 2008 at 12:15

GoogleCodeExporter commented 8 years ago
Hi

I found a Bug on the ExtInfoWindow.

See:

http://gmaps-utility-library-dev.googlecode.com/svn/trunk/extinfowindow/examples
/simpleExample.html

First. Open the Marker Window. 
Then zoom in/out the map. The Marker Window addet per one klick the height more 
then
10px. 

I Found this bug under:

Microsoft Windows XP SP3.0
Mozilla Firefox: 3.0.7
IE 6.0 & 7.0
Google Crome 1.0.154.48

Thanks

M.Nicoletti

Original comment by mnicole...@oct-tuning.com on 24 Mar 2009 at 8:26

GoogleCodeExporter commented 8 years ago
I think no need to edit the extinfowindow.js file

GEvent.addListener(map, "extinfowindowclose", function() {
                    alert('it works');
                });

this worked for me

http://gmaps-utility-library-dev.googlecode.com/svn/trunk/extinfowindow/docs/exa
mples.html#css

Original comment by praveenv...@gmail.com on 17 Jan 2011 at 7:28