As Rossko mentioned, KmlLayers by default will zoom and center the map
to show all of the contained data. If this is not the behavior you
want, then you need to use the perserveViewport option to prevent
this. Then you can use setCenter and setZoom to methods on the map to
show the area you intend.

I'm not sure what Rossko was referring to on your map.setCenter call -
it looks right to me.

Chad Killingsworth

On Sep 25, 3:40 am, Niklasro <[email protected]> wrote:
> Hello
> My setCenter is not working. Can you recommend what I should do? Link
> to map's in code here. Thanks
>
> var saopaulo = new google.maps.LatLng(-23.33, -46.38);
> var browserSupportFlag =  new Boolean();
> var map;
> var infowindow = new google.maps.InfoWindow();
>
> function initialize() {
>   var myOptions = {
>     zoom: 6,
>     mapTypeId: google.maps.MapTypeId.TERRAIN
>   };
>   map = new google.maps.Map(document.getElementById("map_canvas"),
> myOptions);
>   var ctaLayer = new google.maps.KmlLayer('http://www.montao.com.br/
> output.kml');
> ctaLayer.setMap(map);
> map.setCenter(saopaulo)

-- 
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