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.
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);
function globeClickHandler(e) { //breakpoint still causes crash - goodwince 2012-04-11 18:56
What if you used a different event? say "mousedown" or "mouseup"?
google.earth.addEventListener(gep.GetGlobe(), 'mouseup', function(event){
//do something here
});
Gives me access to the variables I want to play with at least - goodwince 2012-04-06 19:37