Google Earth API Samples - Underwater Placemarks

Last Modified:
06/08/2009
Installed Plugin Version:
...

Relevant Resources:

Relevant Code Excerpt:

// Dive underwater
var lookAt = ge.createLookAt('');
lookAt.setAltitudeMode(ge.ALTITUDE_RELATIVE_TO_SEA_FLOOR);
lookAt.setLatitude(26.5);
lookAt.setLongitude(-44.1);
lookAt.setTilt(70);
lookAt.setRange(1500);
lookAt.setHeading(0);
ge.getView().setAbstractView(lookAt);

// Create the placemark
var placemark = ge.createPlacemark('');
placemark.setName('Underwater Placemark');
ge.getFeatures().appendChild(placemark);

// Create style for placemark
var icon = ge.createIcon('');
icon.setHref('http://maps.google.com/mapfiles/kml/shapes/water.png');
var style = ge.createStyle('');
style.getIconStyle().setIcon(icon);
placemark.setStyleSelector(style);

// Create point
var point = ge.createPoint('');
point.setLatitude(lookAt.getLatitude());
point.setLongitude(lookAt.getLongitude());
point.setAltitude(100);
point.setAltitudeMode(ge.ALTITUDE_RELATIVE_TO_SEA_FLOOR);
placemark.setGeometry(point);