Sky, Mars, and Moon

  1. Viewing Sky
  2. Viewing Mars
  3. Viewing the moon

Viewing Sky

The Google Earth Plugin is able to display objects in the sky, such as stars, constellations, planets, the Earth's moon, and galaxies. When the application switches to Sky mode, the viewport transitions to show the sky at a point above the camera's current position, as measured from the center of the Earth (the zenith). The celestial data is mapped onto the inside of a virtual sphere that surrounds the Earth.

Setting the map type

Use the following set method to display Sky mode:


Use the following set method to display Earth mode:




var lookAt = ge.createLookAt('');
lookAt.set(41.28509187215, -169.2448684551622, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 262.87, 0, 162401);



Convert Declination Coordinates


Calculating Range for the LookAt Object

When you use the LookAt object with sky data, you need to perform the following calculations to determine the range. The basic formula is as follows:



  • r is the range, specified in the <LookAt> element.
  • k is equal to 1/tan(α/2), or 1.1917536.
  • β is the desired arc seconds of your sky image.


Here are some sample ranges:

  • Large globular cluster (M15): 20-30 km
  • Andromeda Galaxy: 200 km
  • Planetary Nebula (Owl Nebula): 5-10 km
  • Large Nebula (Trifid Nebula): 10-30 km
  • Open star cluster (Praesepe): 30-60 km
  • Smaller spiral galaxy: 5-10 km
  • Large Magellanic Cloud: 400-500 km

Viewing Mars

The Google Earth Plugin isn't just the Earth and the sky - you can also view detailed imagery of Mars, including 3D terrain. To do so, specify the Mars imagery database when calling the function:'map3d', initCB, failureCB, { database: '' });

Unlike Earth and Sky modes, which use MAP_TYPE_x arguments, Mars can only be loaded upon plugin initialization. To switch from Earth to Mars, you'll need to clear the existing Earth instance before loading a fresh Mars instance:

function showMars() {
  document.getElementById('map3d').innerHTML = '';'map3d', initCB, failureCB, { database: '' });

LookAt and Camera views on Mars work the same way as on Earth. Some interesting locations to get you started are below (view them in the plugin).

  • Olympus Mons, the highest known volcano in the solar system
    lookAt.set(18.4, -134, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 0, 650000);
  • The face on Mars
    lookAt.set(40.717, -9.424, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, -44.158, 0, 10150);
  • Candor Chasma, a large canyon in the Valles Marineris canyon system
    lookAt.set(-6.276, -69.939, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, 3.095, 35, 52800);

Viewing the moon

As with Mars, the moon view requires that its imagery database be specified upon plugin initialization. To do so:'map3d', initCB, failureCB, { database: '' });

LookAt and Camera views on the moon work the same way as on Earth. Some interesting locations to get you started are below (view them in the plugin).

  • The Apollo 11 landing site
    lookAt.set(0.681400, 23.460550, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, -1.946649, 0, 130);
  • The Aitken basin, the largest crater in the solar system
    lookAt.set(-16.800000, 173.400000, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, -4.378803, 0, 135000);
  • The Lambert lunar crater
    lookAt.set(25.238916, -21.138078, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, -1.811669, 0, 78000);

Send feedback about...

Google Earth API (Deprecated)