On Dec 12, 10:05 am, solidream <[email protected]> wrote: > Hello everyone, > > I made a little code to display a map I started on "My Maps" in an > API made map. I display it via the kml file associated to it. It > works fine but I have a small problem: I don't know how to set the > default zoom and position of the map (more generally my map > options) because these seems to be set in a first time and washed > away as soon as the load of the kml file is triggered.
Look at the preserveViewport option to KmlLayer: http://code.google.com/apis/maps/documentation/javascript/reference.html#KmlLayerOptions preserveViewport boolean By default, the input map is centered and zoomed to the bounding box of the contents of the layer. If this option is set to true, the viewport is left unchanged, unless the map's center and zoom were never set. > Maybe I do things in the wrong order I am not sure, still a > beginner with the API. But do you know a solution where either to > force again the position and zoom of the map or do things in an > order so the map options are not ignored ? > > I also want you to know that I don't know the way to set these > parameters on the original kml file as it is taken from one of my > "My Maps" maps. > > Here is my code: Please read and follow the posting guidelines (a link to your map, not code). http://groups.google.com/group/google-maps-js-api-v3/t/2b3f101fd509919e -- Larry > > Thank you all ! -- 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.
