Google Earth Plugin Crash on Click

Go To StackoverFlow.com

2

I'm currently trying to set a breakpoint in the debug window of my browser. Whenever a click event happens the breakpoint causes the Google Earth Plugin to crash.

Is there a method that I'm missing in order to avoid the crash? I just want easy access to trying out different kml properties on a breakpoint. Hoping I was missing a feature similar to the timeout on an alert box to stop the box from crashing when GE is clicked.

Tried to debug in both Chrome and IE.

It's the basic Google Earth code.

google.earth.createInstance(this, initCB, failureCB, earthArgs);

this is the map div and earthArgs holds the database location

............

Click event code:

function initCB(instance) {
  gep = instance;
  gep.getWindow().setVisibility(true);

  google.earth.addEventListener(gep.getGlobe(), 'click', function(event) { 
    //set breakpoint here
  });
}

Code works and loads the GE without issue, the issue is that when clicking on GE the breakpoint freezes up.

2012-04-05 22:52
by goodwince
I created a simple workaround. I don't consider it the answer though. Create a global variable and set it equal to the eventobject when the event happens. Then on another event (button press outside GE) have a breakpoint.

Gives me access to the variables I want to play with at least - goodwince 2012-04-06 19:37

you would need to actually post some code to get help... - Fraser 2012-04-10 18:53
Hope this is helpful to the issue? I can see the confusion. Good to hear from you again Fraser haha - goodwince 2012-04-10 23:06


0

This could be because you are using an anonymous delegate for the event handler. To set a break-point try creating a named function and passing that to the addEventListener method.

 // handle click events on the globe
 // e is the KmlMouseEvent object
 var globeClickHandler = function(e) {
   // set breakpoint here
 };

 // in initCB
 google.earth.addEventListener(gep.getGlobe(), 'click', globeClickHandler);
2012-04-11 00:23
by Fraser
Thanks for looking in from a different perspective. I tried your method and no go. I even tried..

function globeClickHandler(e) { //breakpoint still causes crash - goodwince 2012-04-11 18:56



0

What if you used a different event? say "mousedown" or "mouseup"?

google.earth.addEventListener(gep.GetGlobe(), 'mouseup', function(event){ 
    //do something here  
});
2012-07-20 20:50
by Matt
Ads