When first loading a page with GE API, can't you just go directly to your desired location, and not see the whole globe first?

78 views
Skip to first unread message

bbb1000

unread,
Aug 11, 2008, 10:26:32 AM8/11/08
to KML Developer Support - Google Earth Browser Plugin
I've been using the following code when initializing my page
function init() {
google.earth.createInstance("map3d", initCallback,
failureCallback);
}
function initCallback(object) {
ge = object;
ge.getWindow().setVisibility(true);
var navControl = ge.getNavigationControl();
navControl.setVisibility(ge.VISIBILITY_SHOW);
var la = ge.createLookAt('');
la.set(xxxxx,yyyyy, zz, ....);
ge.getView().setAbstractView(la);
}

But, the problem is you will first see the globe (briefly, but still),
then you're taken to the location of your LookAt.

I mean it's giving me a headache and wonder if there's a way you can
bypass the view of the whole globe in the beginning.

Roman N

unread,
Aug 11, 2008, 2:28:32 PM8/11/08
to KML Developer Support - Google Earth Browser Plugin
You can use a fly-to speed of SPEED_TELEPORT (or even higher values)
to achieve this effect. Try this:

function initCallback(object) {
ge = object;
ge.getWindow().setVisibility(true);

// use a very fast fly to speed when flying to the start
location
var oldFlyToSpeed = ge.getOptions().getFlyToSpeed();
ge.getOptions().setFlyToSpeed(ge.SPEED_TELEPORT);

var navControl = ge.getNavigationControl();
navControl.setVisibility(ge.VISIBILITY_SHOW);
var la = ge.createLookAt('');
la.set(xxxxx,yyyyy, zz, ....);
ge.getView().setAbstractView(la);

// revert to the old fly to speed
ge.getOptions().setFlyToSpeed(oldFlyToSpeed);
}

- Roman

bbb1000

unread,
Aug 12, 2008, 4:08:44 AM8/12/08
to KML Developer Support - Google Earth Browser Plugin
Hi Roman,
works like a charm
Seeing the page loads many times gave me a headache and it's not
convenient to have to try to look away everytime you're opening your
page.

Thank you so much.
Reply all
Reply to author
Forward
0 new messages