preserveViewport: true tells the API NOT to adjust the map center and
zoom level when loading a KML file. I believe you want
preserveViewport: false.

Chad Killingsworth

On Jul 9, 2:46 pm, Joseph Elfelt <[email protected]> wrote:
> Alas, I have not been able to figure out how to do these two things
> with KML files:
>
> A.  When the map first appears on the user's screen, then display a
> KML file and let the API automatically set the map center and zoom
> B.  As the user toggles the KML on/off, preserve the viewport
>
> Below is Google's KML demo map to which I added
> preserveViewport:true
> Adding this setting is the key to doing item 'B'.
>
> However, the initial appearance of the map (item 'A') uses the zoom
> setting in the options and as a result only part of the KML data is on
> the map.  When I  tried deleting the zoom setting in the options, then
> I got a blank map.
>
> http://www.mappingsupport.com/forum_post/preserveViewport_kml_10.html
>
> I know how to toggle the KML on/off.
>
> Any ideas for how I can get all the KML to appear on the map when it
> first appears on the screen?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to