Show Preview
Show Cesium Code
Show Google Earth Code
For Google Earth Developers
All Google Earth examples
Additional Resources
Tutorials
Cesium Sandcastle
Reference Documentation
Relevant Cesium Source
Relevant Google Earth Source (
link
)
function addToLineString(lineString, lat, lng, latOffset, lngOffset) { var altitude = 1.0; // give it some altitude lineString.getCoordinates().pushLatLngAlt(lat + latOffset, lng + lngOffset, altitude); } var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND); var lat = lookAt.getLatitude(); var lng = lookAt.getLongitude(); // create the line string placemark var lineStringPlacemark = ge.createPlacemark(''); // create the line string geometry var lineString = ge.createLineString(''); lineStringPlacemark.setGeometry(lineString); // tessellate (i.e. conform to ground elevation) lineString.setTessellate(true); // add the the points to the line string geometry addToLineString(lineString, lat, lng, 0, 0, 0); addToLineString(lineString, lat, lng, 1.5, .5, 0); addToLineString(lineString, lat, lng, 0, 1.0, 0); addToLineString(lineString, lat, lng, 1.5, 1.5, 0); addToLineString(lineString, lat, lng, 0, 2.0, 0); addToLineString(lineString, lat, lng, 1.5, 2.5, 0); addToLineString(lineString, lat, lng, 0, 3.0, 0); addToLineString(lineString, lat, lng, 1.5, 3.5, 0); addToLineString(lineString, lat, lng, 0, 4.0, 0); addToLineString(lineString, lat, lng, 1.5, 4.5, 0); ge.getFeatures().appendChild(lineStringPlacemark);