google.load("earth", "1"); var ge = null; var lookAt; function init() { google.earth.createInstance("map3d", initCB, failureCB); } function initCB(object) { ge = object; ge.getWindow().setVisibility(true); ge.getSun().setVisibility(true); lookAt = ge.createLookAt(''); ge.getTime().getControl().setVisibility(false); lookAt.set(0.0, 0.0, 2000000, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 0, 0); lookAt.setTilt(25); ge.getView().setAbstractView(lookAt); var options = ge.getOptions(); options.setFlyToSpeed(5); } function failureCB(object) { alert('load failed'); } function twirl() { var lat; var lng; var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND); lat=(lookAt.getLatitude() + 0); lng=(lookAt.getLongitude()+0.1); if (lng>=179.9) { lng=-179.9; }; // lookAt.setLatitude(lat); // lookAt.setLongitude(lng); lookAt.set(0.0, lng, 2000000, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 0, 0); lookAt.setTilt(25); ge.getView().setAbstractView(lookAt); } function showSun(choice) { if (choice) { ge.getSun().setVisibility(true); return; }; ge.getSun().setVisibility(false); return; } function show() { window.setInterval(twirl, 20); };