Simple KML with only one location specifed

164 views
Skip to first unread message

pinshah

unread,
Sep 26, 2008, 7:49:11 AM9/26/08
to KML Developer Support - Getting Started with KML
I am creating a KML file with a single location specified but when
viewed on the maps.google.com page, it zooms in to the max level and i
get messages in the background

We are sorry, but we dont have maps at this zoom level. I am sure it
worked earlier. Any idea? Here is the KML

<?xml version="1.0" ?>
- <kml xmlns="http://earth.google.com/kml/2.0">
- <Document>
- <Placemark>
<name>2</name>
<description>Near Alfa, VILE PARLE - WEST, MUMBAI, MAHARASTRA,
INDIA</description>
- <Point>
<coordinates>72.839152,19.108058,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>

Bocha10

unread,
Sep 26, 2008, 5:19:06 PM9/26/08
to KML Developer Support - Getting Started with KML
I am pretty sure that Google will automatically fit the "zoom" to
better display your data.
To avoid this default behavior and get a consistent "zoom" no matter
how many times I edit the kml file and how many markers I add or
remove I use the LookAt tag.
Give it a try
http://code.google.com/apis/kml/documentation/kmlreference.html#lookat

barryhunter [KML Guru]

unread,
Sep 26, 2008, 5:32:51 PM9/26/08
to KML Developer Support - Getting Started with KML
<Lookat> is not supported in Google Maps
http://code.google.com/apis/kml/documentation/kmlelementsinmaps.html


The only solution I can think of is a transparent image used as a
ground overlay. Google maps will resize to fit that.
(you could also do it with some fake placemarks, but I think they will
always show an icon in Google Maps - and if just use a transparent
icone it will still be clickable)


On Sep 26, 10:19 pm, Bocha10 wrote:
> I am pretty sure that Google will automatically fit the "zoom" to
> better display your data.
> To avoid this default behavior and get a consistent "zoom" no matter
> how many times I edit the kml file and how many markers I add or
> remove I use the LookAt tag.
> Give it a tryhttp://code.google.com/apis/kml/documentation/kmlreference.html#lookat

Bocha10

unread,
Sep 27, 2008, 7:48:46 PM9/27/08
to KML Developer Support - Getting Started with KML
Actually it is.
I have used it in a kml file to jump to different geographical
locations when clicking in their folders, and works like a charm.
That link must be outdated, like many other help pages in Google.

On Sep 26, 5:32 pm, barryhunter [KML Guru] wrote:
> <Lookat> is not supported in Google Mapshttp://code.google.com/apis/kml/documentation/kmlelementsinmaps.html

barryhunter [KML Guru]

unread,
Sep 27, 2008, 8:54:54 PM9/27/08
to KML Developer Support - Getting Started with KML
Do you have an example?

This dont seem to work
http://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookat1.kml
(the lookat specifies a broad view of South wales not an exact point)

using Folders with lootats doesnt work when loaded:
http://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookats.kml
But you can click on the folders to jump to the 'lookat' which is
something hadnt seen before.



A image overlay works nicely:
http://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookat2.kml

but it doesnt get hidden - like it does in Google Earth :(

Bocha10

unread,
Sep 29, 2008, 12:35:23 PM9/29/08
to KML Developer Support - Getting Started with KML
Hi Barry,
I just took a look at your files and noticed that you put the LookAt
tag inside the placemark tag.
I have never used it that way, rather I put the the LookAt tag inside
a container like Document or Folder.

Following with the example by pinshah, his original kml file will be
rendered at street level by Google as is.
By adding a LookAt tag at the Document level, the view can be modified
for any desired "zoom" by the altitude argument as follows

<?xml version="1.0" ?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<LookAt>
<longitude>72.839152</longitude>
<latitude>19.108058</latitude>
<altitude>0</altitude>
<range>54321</range>
<tilt>0</tilt>
</LookAt>
<Placemark>
<name>2</name>
<description>
Near Alfa, VILE PARLE - WEST, MUMBAI, MAHARASTRA, INDIA
</description>
<Point>
<coordinates>72.839152,19.108058,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>

In this case, I used the lat/long values of the placemark for the lat/
long values for the LookAt tag, so the placemark will be centered.
It is my understanding that this will fix the problem experienced by
pinshah, although I must say that I do not get the error message he
gets, just a street map at the max zoom level.


On Sep 27, 8:54 pm, barryhunter [KML Guru] wrote:
> Do you have an example?
>
> This dont seem to workhttp://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookat...
> (the lookat specifies a broad view of South wales not an exact point)
>
> using Folders with lootats doesnt work when loaded:http://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookat...
> But you can click on the folders to jump to the 'lookat' which is
> something hadnt seen before.
>
> A image overlay works nicely:http://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookat...

barryhunter [KML Guru]

unread,
Sep 29, 2008, 12:54:34 PM9/29/08
to KML Developer Support - Getting Started with KML
ah cool! So its 'partly' supported then ;)

I've put your example here:
http://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookat3.kml
to make it easier to see.
(wihtout the lookat
http://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookat3s.kml

> although I must say that I do not get the error message he
gets
Depends on where you look - does the area have mapping at a high
enough resolution.

Bocha10

unread,
Sep 29, 2008, 1:47:20 PM9/29/08
to KML Developer Support - Getting Started with KML
Thank you for hosting my kml file.

With respect to the error message I noticed something interesting.
If I click the above link for the kml file without the LookAt I get
the error message about maps not available for that zoom level. The
Zoom bar has 22 steps and is set at the max zoom.
However, if I first go to maps.google.com, and then enter the the url
of the kml file in the Google Maps search box, now I get map tiles,
but the zoom bar has only 17 steps and is set again to the max zoom.
This is what I was referring as street map in my previous post.

Any ideas why the different behavior? The Maps API version reported by
GMAPS_API_VERSION is 130d.

On Sep 29, 12:54 pm, barryhunter [KML Guru] wrote:
> ah cool! So its 'partly' supported then ;)
>
> I've put your example here:http://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookat...
> to make it easier to see.
> (wihtout the lookathttp://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookat...

barryhunter [KML Guru]

unread,
Sep 29, 2008, 5:08:23 PM9/29/08
to KML Developer Support - Getting Started with KML


On Sep 29, 6:47 pm, Bocha10 wrote:
> Thank you for hosting my kml file.
>
> With respect to the error message I noticed something interesting.
> If I click the above link for the kml file without the LookAt I get
> the error message about maps not available for that zoom level. The
> Zoom bar has 22 steps and is set at the max zoom.
> However, if I first go to maps.google.com, and then enter the the url
> of the kml file in the Google Maps search box, now I get map tiles,
> but the zoom bar has only 17 steps and is set again to the max zoom.
> This is what I was referring as street map in my previous post.

Interestesting, yes see what you mean! I just attributed the diffrence
to change of location, but it does depend on how you load the file.
Off to the KML issue tracker....


Of course another way to fix it is to do
http://maps.google.com/?q=http://www.nearby.org.uk/google/temp/Lookat3s.kml&z=11
:)

barryhunter [KML Guru]

unread,
Sep 29, 2008, 5:15:01 PM9/29/08
to KML Developer Support - Getting Started with KML

Bocha10

unread,
Sep 29, 2008, 7:40:18 PM9/29/08
to KML Developer Support - Getting Started with KML
Thank you for reporting it.

On Sep 29, 5:15 pm, barryhunter [KML Guru] wrote:
> http://code.google.com/p/kml-samples/issues/detail?id=195
Reply all
Reply to author
Forward
0 new messages