Layers contain additional information that is draped over the base Google Earth imagery layer. Navigation controls allow the user to pan, tilt, and zoom using controls superimposed on the viewport.
By default, the terrain layer is the only layer displayed when the Google Earth Plugin first loads. Not all of the layers that are available in the Google Earth desktop client are available with the plugin. Available layers are:
LAYER_BORDERS- shows country and area borders, and place labels for cities, states, countries, oceans, etc
LAYER_BUILDINGS- 3D buildings
LAYER_BUILDINGS_LOW_RESOLUTION- grey buildings (non-photorealistic). Note that this does not contain copies of photorealistic buildings; rather, it includes buildings that do not yet exist in the photorealistic buildings layer. As photorealistic versions of grey buildings are created, the buildings will be added to
LAYER_BUILDINGSand removed from
LAYER_ROADS- displays roads and road names
LAYER_TERRAIN- 3D terrain
LAYER_TREES- 3D tree models
To enable a specific layer:
To disable a layer:
Atmosphere and Sun
The Google Earth Plugin can display the sun as well as the Earth's atmosphere. The Sun casts shadows and appears in the sky in the correct location according to the specified time (see the Developer's Guide chapter on Time for more information); the atmosphere is displayed as gradiated blue coloring to mimic the scattering of light as it passes through the atmosphere.
To toggle the Sun in the plugin:
To toggle the atmosphere in the plugin:
Navigation controls allow a user to move around in Google Earth, and include zoom, pan, tilt, scroll, and rotate controls. These can be always visible, never visible, or can be hidden until the user moves their mouse cursor over the controls' area in the plugin. To specify which behavior to display:
The acceptable values are:
Positioning the controls
The navigation controls can be positioned at any corner of the Google Earth Plugin window. To do so, change the value of the x and y units to be relative to either the top or bottom of the window, and either the left or right.
ge.UNITS_PIXELS: interpreted as pixels from the left of bottom edge of the plugin window
ge.UNITS_INSET_PIXELS: interpreted as pixels from the right or top edge of the plugin window
For example, to move the controls to the bottom right of the window:
Note: the navigation controls do not accept specific pixel
) for positioning.
For an interactive example, visit the Earth API section of the Ajax APIs Playground: Show/Hide Navigation Controls.
Google Earth also provides a set of informational overlays that can be added to the plugin window. These overlays communicate information about the current viewport - latitude, longitude, altitude, etc.
||Displays the current scale of the map.|
||Displays a status bar at the bottom of the Earth window, containing geographic coordinates and altitude of the terrain below the current cursor position, as well as the range from which the user is viewing the Earth.|
||Displays an inset map of the entire world in the bottom right corner. The current viewport is displayed on the inset map as a red rectangle.|
||Displays the lines of latitude and longitude on the globe.|
||Displays scattered light in the Earth's atmosphere.|