How to?: Set viewing altitude in KML file

2,270 views
Skip to first unread message

JohnWoram

unread,
Jun 3, 2010, 9:48:48 AM6/3/10
to KML Developer Support - Getting Started with KML
If I write a simple KML file to display one placemark in Google Earth,
the <range> value seems to set the viewing altitude. But if I set two
or more placemarks, and set the viewing altitude so that some of the
surrounding area is shown, Google Earth ignores the <range> value. It
simply zooms in so that the placemarks are within the displayed area,
but little or no surrounding area is seen.

So, is there a way to "force" Google Earth to display multiple
placemarks at the eye altitude that I specify? I suppose there's some
"trick" to get this to work, but I've tried every variation I can
think of (via Properties, and so on), and nothing has any effect.

Any suggestions?

Thanks, John

nicodemussunrise

unread,
Jun 6, 2010, 5:29:31 PM6/6/10
to KML Developer Support - Getting Started with KML
Hi John,

If I understand correctly, you want each placemark to have its own
unique view. This is easily accomplished by using the 'LookAt' kml
tag. (see http://code.google.com/apis/kml/documentation/kmlreference.html#lookat
for documentation). Alternatively, you can set the view from within GE
itself, by selecting the placemark, moving the view to the desired
position, right-clicking on the placemark and selecting 'Snapshot
view'.

Does that answer your question?

-ns

JohnWoram

unread,
Jun 6, 2010, 7:22:44 PM6/6/10
to KML Developer Support - Getting Started with KML
On Jun 6, 5:29 pm, nicodemussunrise wrote:
> Hi John,
>
> If I understand correctly, you want each placemark to have its own unique view. This is easily accomplished by using the 'LookAt' kml tag.

Yes, I've used the 'LookAt' tag, and as long as I have only one
placemark, I can specify the eye altitude by including the following
tags:
<range>241402</range>
<altitudeMode>relativeToGround</altitudeMode>
This sets the altitude at 150 miles, which is just what I want. But
now, if I add a second placemark, the <range> and <altitudeMode>
settings are ignored. Google Earth zooms in so that one placemark is
near the left side of the window, the other near the right. If both
placemarks are offshore in a bay of water, all I see is a screen full
of water and I need to zoom out to return to the 150 mile eye
altitude.

As a work-around, I've added two more placemarks -- one to the left of
the desired placemark pair, the other to the right--no icon, no name,
so that keeps them invisible. But now, G. E. zooms in on these
invisible placemarks and I see the surrounding area. Not very elegant,
but it works. So I'm looking for a tag setting, or whatever, that
would force G. E. to just display every placemark in the KML file at
the eye altitude that I want.

Nymor

unread,
Jun 6, 2010, 11:59:16 PM6/6/10
to KML Developer Support - Getting Started with KML
Hi,

There are 2 ways you can use the LookAt.

1. If you add a LookAt within the Placemark then that is the one that
is used when you double-click it and also, as it would appear, the
default LookAt that is used if only one Placemark is present.

2. You can also add a LookAt within the Document tag (in addition to
the ones within the Placemarks). If you have one at the Document level
then that is the one that is used when you open the KML.

If more than one Placemark is present and there isn't a LookAt at the
Document level then GE will position itself to best fit the Placemarks
present. If you add a Document level LookAt with the values you want
then you should get the results you are after.

Hope that helps.

Regards
Nymor

JohnWoram

unread,
Jun 17, 2010, 9:03:29 AM6/17/10
to KML Developer Support - Getting Started with KML
Hi Nymor,
Sorry for the delay in replying, and thanks for the tip -- that does
exactly what I was looking for. I added the following just under the
<Document> tag. This properly centers the image where I want it, and
sets the Eye alt at 150 miles (ie, 241402 meters).

<LookAt>
<longitude>-73.5</longitude>
<latitude>-0.5</latitude>
<range>241402</range>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>

Thanks again,

John

Robin Chacko

unread,
Jan 19, 2014, 9:28:05 PM1/19/14
to kml-support-g...@googlegroups.com
Good. Thanks
Reply all
Reply to author
Forward
0 new messages