be88ex / earth-api-samples

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

Accuracy of flying to a location with ALTITUDE_RELATIVE_TO_GROUND is contingent on altitude data streaming progress #263

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. request a page and GE plug in will stall or revert to general geo
location but not find the model's exact coordinates

2. refresh the same page and GE plug in will find model and camera view or
lookAt coordinates.

What is the expected output or behavior? What do you see instead?
GE plug in finds the model on first page load. 

GE plug in stalls or reverts to general geo area. Sometimes the model will
show briefly before GE finishes loading. 

Which plugin version are you using?
5.16

Which browsers and operating systems are affected?
Known - Firefox 3 + Safari 3+

Please provide any additional information (code snippets/links) below.

here's  a link & the relevant Java script.
http://www.guggenheim.org/new-york/education/sackler-center/design-it-shelter/vi
ew-shelters/project/25

<script type="text/javascript"> /* <![CDATA[ */
 var ge;
google.load("earth", "1");

function init() { google.earth.createInstance('map3d', initCB, failureCB);}
function initCB(instance) {ge = instance; ge.getWindow().setVisibility(true);   
ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
ge.getOptions().setStatusBarVisibility(1);
ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN, true);

// fetch a KML file and show it

function finished(object) {
if (!object) {
setTimeout(function() {
alert('Bad or null KML.');
}, 0);
return;
}
ge.getFeatures().appendChild(object);
var placemark = object.getFeatures().getChildNodes().item(1);
var modelLocation = placemark.getGeometry().getLocation();
var la = ge.createLookAt('');
var lat = modelLocation.getLatitude();
var lng = modelLocation.getLongitude();
var alt =2.5;
la.set(lat, lng, alt, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 70, 20);
ge.getView().setAbstractView(la); 

}
var url = 'http://sketchup.google.com/' + 

'3dwarehouse/download?mid=ff94fabfcc942ff434f2582b9b56157e&rtyp=k2';
google.earth.fetchKml(ge, url, finished);

}
function failureCB(errorCode) {
}

/* ]]> */
</script>

Original issue reported on code.google.com by cborkows...@gmail.com on 8 Jun 2009 at 1:58

GoogleCodeExporter commented 8 years ago
Hi, see my response in
http://groups.google.com/group/google-earth-browser-plugin/browse_thread/thread/
709bfa2dc0b1bcd8/:

"Ah, I believe this is the problem of data streaming. You're setting an
abstract view relative to ground, but the the ground altitude data
hasn't finished streaming in yet.

I'd suggest one-time calculating the ground altitude at the model's
location using ge.getGlobe().getGroundAltitude(), and then using that
altitude with a mode of ALTITUDE_ABSOLUTE in the flyto.

Hope that helps!
Roman"

This is kind of a 'known behavior'.. using relative to ground depends on data
streaming progress. For now, marking this as WontFix.

Original comment by api.roman.public@gmail.com on 11 Jun 2009 at 7:03