Show Preview
Show Cesium Code
Show Google Earth Code
For Google Earth Developers
All Google Earth examples
Additional Resources
Tutorials
Cesium Sandcastle
Reference Documentation
Enable Event
Disable Event
Relevant Cesium Source
Relevant Google Earth Source (
link
)
var eventListenerActive; function enableListener() { if (!eventListenerActive) { google.earth.addEventListener(placemark, 'click', myEventHandler); eventListenerActive = true; } } function disableListener() { if (eventListenerActive) { google.earth.removeEventListener(placemark, 'click', myEventHandler); eventListenerActive = false; } } function myEventHandler(event) { // wrap alerts in API callbacks and event handlers // in a setTimeout to prevent deadlock in some browsers setTimeout(function() { alert('You clicked the placemark!'); }, 0); }