Export to GitHub

earth-api-samples - issue #148

Earth opens with globe rotated 90 deg clockwise


Posted on Jan 24, 2009 by Happy Monkey

The code below used to open with the globe oriented as usual (north pole up) but lately opens with the globe rotated 90 degrees clockwise. Adding setHeading(0) returns the globe to north up. Roman suggested posting notice of this here (he hasn't seen the code -- maybe there is an error or omission in the code causing/permitting the effect).

The system I saw this on was running Vista Home Premium and IE7/FF3.

Here are code snippets:

<script type="text/javascript" src="http://www.google.com/jsapi?key=... ... google.load("earth", "1"); ... google.earth.createInstance("mapCanvas", initCB, failureCB); ...

function initCB(obj) { ge = obj; ge.getWindow().setVisibility(true); ge.getOptions().setStatusBarVisibility(true); // ge.getOptions().setScaleLegendVisibility(true); // wait until scale available in metric ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW); var lat = 37; var lng = -100; var tilt = 0; var range = 8000000; flyTo(lat, lng, tilt, range); ... }

function flyTo(lat, lng, tilt, range) { var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND); lookAt.setLatitude(lat); lookAt.setLongitude(lng); lookAt.setTilt(tilt); lookAt.setHeading(0); // new; without this, north pole points right lookAt.setRange(range); ge.getView().setAbstractView(lookAt); }

Comment #1

Posted on Jan 26, 2009 by Happy Monkey

(No comment was entered for this change.)

Comment #2

Posted on Apr 2, 2009 by Happy Monkey

Fixed as of 5.0.11655.6079

http://code.google.com/apis/earth/documentation/releasenotes.html#2009-03-31

Status: Fixed

Labels:
Type-Defect Priority-Medium Internal-1594491