Kazu46Machi / earth-api-samples

Automatically exported from code.google.com/p/earth-api-samples
0 stars 0 forks source link

Add open and close events to information balloons #116

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What should this feature enhancement do?

Raise BalloonOpen and BalloonClose events that will let the user create a 
listener, and trigger other program actions when the event fires.

Are there any known workarounds that produce the similar results?

In order to respond to the ballon closing, it's now necessary to check the 
balloon via getBalloon() to see if it's null.  I have used the following 
code:

 // Put this in a place that will be called when the balloon opens, such 
as in the addEventListener for the map feature.  This starts after a 
delay, which is needed because the balloon is null until after the 
addEventListener code is called, so the delay gives it a chance to "catch 
up".

setTimeout("closeDiv()",1000); 

//---------------------------------------------------------------------
// closeDiv - Closes the information div.  This makes a "listener" for
// the balloon; if getBalloon returns not null, the function calls
// itself recursively after a 1/2 second delay.  If it returns null,
// the function turns off an information div called rightInterior via
// a call to a showHide function.  Anything that you want to happen
// when the ballon closes can be called this way.
//---------------------------------------------------------------------
function closeDiv() { 
  if (ge.getBalloon()!=null) {setTimeout("closeDiv()",500);}
  else {showHide("rightInterior", "hidden");}
}

Thanks,

-Steve

Original issue reported on code.google.com by SavageSt...@gmail.com on 10 Dec 2008 at 1:44

GoogleCodeExporter commented 8 years ago
There's a balloonclose event; see 
http://code.google.com/apis/earth/documentation/reference/interface_g_e_plugin.h
tml#2d9
90319bb92b689d527c1e26dbdb8b4

Original comment by tulr...@google.com on 19 Mar 2010 at 7:55

GoogleCodeExporter commented 8 years ago
Indeed. This issue should be marked as Fixed.

Original comment by underbluewaters on 3 Feb 2011 at 7:24

GoogleCodeExporter commented 8 years ago

Original comment by jli...@google.com on 3 Feb 2011 at 7:29