getting camera/lookat info for a tour

70 views
Skip to first unread message

Marcin Pawlowski

unread,
Aug 21, 2008, 3:00:04 PM8/21/08
to KML Developer Support - Google Earth Browser Plugin
I'm looking to create a tour in the google earth plugin. I remember
seeing a ge mashup that gave you current data of your view (or the
camera) but I can't find it anymore. The data included was the
latitude, longitude, tilt, heading etc...

Anyone have any idea what I'm talking about? Or is there a way to get
all of this info using google earth?

Marcin Pawlowski

unread,
Aug 21, 2008, 5:05:57 PM8/21/08
to KML Developer Support - Google Earth Browser Plugin
I couldn't find it so I wrote one myself.

http://www.cs.ucsb.edu/~marcin/gecamera/

enjoy

Marcin Pawlowski

unread,
Aug 21, 2008, 5:49:36 PM8/21/08
to KML Developer Support - Google Earth Browser Plugin
I just noticed when I searched the group for information about tours
use kmlLookAt rather than kmlCamera, and the sample code for tours is
for kmlLookAt.

sample code: http://code.google.com/p/gmaps-samples/source/browse/trunk/earth/gddmc.html

So people don't get confused, here's the (relevant) code for kmlCamera
tours:

function changeCamera(ge, cam, lat, lng, heading, tilt, altitude) {
cam.set(lat, lng, altitude, ge.ALTITUDE_RELATIVE_TO_GROUND, heading,
tilt, 0);
ge.getView().setAbstractView(cam);
}

function initTour() {
ge.getOptions().setFlyToSpeed(1.0);
cam = ge.createCamera('');
setTimeout("changeCamera(ge,cam,19.302856,-99.150419,0,45,10000)",0);
setTimeout("changeCamera(ge,cam,19.435417,-99.202389,0,45,10000)",
11000);
setTimeout("changeCamera(ge,cam,19.387586,-99.253947,270,70,10000)",
22000);
setTimeout("changeCamera(ge,cam,19.424292,-99.175425,0,45,10000)",
33000);
}

This code gives the same tour as the sample but with kmlCamera rather
than kmlLookAt

Roman N

unread,
Aug 21, 2008, 8:22:53 PM8/21/08
to KML Developer Support - Google Earth Browser Plugin
Marcin,

Nice sample--very simple and readable code. I'm compiling a list of
nice samples such as this for linking on our documentation pages. I'll
get in contact with you soon about including this one, if you're
interested.

- Roman

On Aug 21, 2:49 pm, Marcin Pawlowski wrote:
> I just noticed when I searched the group for information about tours
> use kmlLookAt rather than kmlCamera, and the sample code for tours is
> for kmlLookAt.
>
> sample code:http://code.google.com/p/gmaps-samples/source/browse/trunk/earth/gddm...

Marcin Pawlowski

unread,
Aug 22, 2008, 12:52:35 PM8/22/08
to KML Developer Support - Google Earth Browser Plugin
Definitely interested, let me know.
Reply all
Reply to author
Forward
0 new messages