Google Earth API Samples - Alternate Spheres/Servers

Last Modified:
07/17/2009
Installed Plugin Version:
...
Choose a sphere:

Relevant Resources:

Relevant Code Excerpt:

updateSphere();

function updateSphere() {
  var sphereNode = document.getElementById('sphere');
  var options = {};
  if (sphereNode.value == 'moon' ||
      sphereNode.value == 'mars')
    options = { database: 'http://khmdb.google.com/?db=' + sphereNode.value };

  document.getElementById('map3d').innerHTML = '';
  google.earth.createInstance('map3d', initCB, failureCB, options);
}
Choose a sphere:
<select id="sphere" onchange="updateSphere()">
  <option value="earth">Earth</option>
  <option value="mars">Mars</option>
  <option value="moon">Moon</option>
</select>