In Google Earth (web browser plug-in, GE API), I am moving the camera from point A to point B by changing the coordinates. It works, but GE always seems to do a high jump while enroute.
Example (using ge.ALTITUDE_ABSOLUTE setting)
Point A: camera.setLatitude(50.1);camera.setLongitude(14.1);camera.setAltitude(1000.0);
Point B: camera.setLatitude(51.1);camera.setLongitude(15.1);camera.setAltitude(1000.0);
(note identical altitude 1000 m at both points).
The location change works fine, but enroute GE zooms out with Eye Alt. going up to 72 km, and then back again to the desired 1000.0 m (value read off the status line, with flyTo speed set to very slow).
Is there a way to suppress this high jumping, and stay at a fixed altitude? I can't so far not even find a comprehensive description of this behaviour, let alone parameters to control it.
(Obviously, "flightsim" type GE applications can do it, but I think they are not using coordinate changes, but rather basing movement on heading/speed data). But it would seem somewhat silly to have to turn the two coordinate sets first into speed/velocity and then back into coordinates, only to achieve constant altitude movement.)
Thanks for all hints.
If you are looking for smooth animation when using the GE plugin, then I can flat out tell you that the default algorithm that GE uses will not suffice. Your best bet will be to set the flyToSpeed to teleport like this:
ge.getOptions().setFlyToSpeed(ge.SPEED_TELEPORT);
and then create the transition path yourself, either by interpolating the frames inbetween the starting point and the ending point, or predefining those frames (hint: you will need a lot more intermediary points).
The easiest way to do this, is to hook into the frameend event, which fires as soon as the plugin completes drawing the screen, and then immediately reposition the camera. The best example I can think of that demonstrates this is here:
http://earth-api-samples.googlecode.com/svn/trunk/examples/event-frameend.html
unfortunately, this example works in a straight line, making the camera curve is much mor e challenging.
Another alternative might be to check out the GE plugins native support for KML, by loading a KML tour, and playing through the plugin, you can make the plugin do the heavy lifting,