Kazu46Machi / earth-api-samples

Automatically exported from code.google.com/p/earth-api-samples
0 stars 0 forks source link

Earth opens with globe rotated 90 deg clockwise #148

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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);
}

Original issue reported on code.google.com by elder....@gmail.com on 24 Jan 2009 at 7:05

GoogleCodeExporter commented 8 years ago

Original comment by api.roman.public@gmail.com on 26 Jan 2009 at 6:12

GoogleCodeExporter commented 8 years ago
Fixed as of 5.0.11655.6079

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

Original comment by api.roman.public@gmail.com on 2 Apr 2009 at 4:24