Search code examples
javascriptgoogle-earthgoogle-earth-plugin

Refresh Google Earth plug-in without refreshing page


I made a web application that is heavily dependent on Google Earth plug-in. There are times that it crashes due to unknown reasons.

I was wondering if there ways to :

  1. catch when the plug-in crashed
  2. refresh the plug-in without refreshing the page

Solution

  • For your question number 1) - see my answer on this SO Question

    For 2) - I haven't tested this, but when you detect the plug-in has crashed, try running your initial function again. The one that should look something like this

    function init() {
      google.earth.createInstance('map3d', initCB, failureCB);
    }