A link to change the camera view (ASAP)

4 views
Skip to first unread message

GE

unread,
Jun 20, 2011, 4:45:21 PM6/20/11
to Google Earth API
So this seems pretty simple, but I haven't come across anything that I
understood. I was hoping that somebody could simplify my problem for
me.

I want to be able to click on a name of a city (outside of Google
Earth plugin), and I want it to change the camera view to that
location (specified by me). I have my plugin working, and everything
is set, but I want to be able to control where I'm looking at outside
of the plugin. Please help!

I thank everyone for their help beforehand. This has given me a
headache.

Tae

unread,
Jun 20, 2011, 4:48:14 PM6/20/11
to Google Earth API
Edit: The city name will be an html element. Right now it is just <p
id="view">click here</p>. I'm pretty new to this, so simple help would
be nice!

Paul van Dinther

unread,
Jun 20, 2011, 5:12:03 PM6/20/11
to google-e...@googlegroups.com
Have a look here: http://www.planetinaction.com/sound/
On the right hand side are links that take you to various views. Each
link calls a setView javascript routine that looks like this (Assuming
the variable ge is a reference to your google earth plugin object):

function setView(latitude, longitude, range){
var la = ge.createLookAt('');
la.set(latitude,longitude, 0,ge.ALTITUDE_RELATIVE_TO_GROUND,
340, 70, range);
ge.getView().setAbstractView(la);
}

http://www.planetinaction.com/gearthframework/index.htm shows you a
way to implement a Google Earth plugin to your page.

I hope this helps you.

> --
> You received this message because you are subscribed to the Google Groups "Google Earth API" group.
> To post to this group, send email to google-e...@googlegroups.com.
> To unsubscribe from this group, send email to google-earth-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-earth-api?hl=en.
>
>

--
Regards

Paul van Dinther
Our Google Earth creations at www.planetinaction.com

Reply all
Reply to author
Forward
0 new messages