views:

1030

answers:

1

Hi everyone,

I have the following kml file that I am loading in Google map, it's locating the pointer correctly however the it's always zoomed at the maximum level.

Using the google map APIs I can set my own zoom level but I am trying to do this using an embedded map in an iFrame (provided by google).

Are there anyways to set the zoom level in the kml itself? I had a look at LookAt and the Camera attribute but the doc say they aren't supported in Google Map.

Thanks!

<?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns="http://earth.google.com/kml/2.1"&gt;  
        <Placemark>
            <Point>
                <coordinates>144.897426,-37.8045</coordinates>
            </Point>
        </Placemark>
    </kml>
+3  A: 

You can control Google Map's display behaviour by the arguments you pass in the src of the iframe element - in your case by setting the "z" parameter - see here

simply make your iframe source as "http://maps.google.com/?ll=48.064372,16.348977&amp;z=10" and change z=10 to any other higher (up to 20) or lower value (down to 0)

Alternatively, in the Maps API you would use the setCenter() function to set the zoom level

MikeD
Thanks for that! tested and confirmed. I was looking WAY to deep for my solution. Nice resource you linked, I'll keep it in my bookmark.Have a great day.
jfrobishow