On Sep 16, 10:20 am, champ <[EMAIL PROTECTED]> wrote:
> I searched but I couldnt find how to set the initial zoom level.

Did you think to look at the documentation:
http://code.google.com/apis/maps/documentation/reference.html#GMap2.Methods.Modify-the-Map-State
setCenter(center, zoom?, type?)
none
Sets the map view to the given center. Optionally, also sets zoom
level and map type. The map type must be known to the map. See the
constructor, and the method addMapType(). This method must be called
first after construction to set the initial state of the map. It is an
error to call operations on a newly constructed GMap2 object until
after this function is invoked.

Try the optional zoom argument.

> I tried something but it doesnt work, When i alert the coming zoom
> value, it seems normal. but it doesnt work with initializing the map.
> What am i doing wrong?

Please post a link to your map.  We can't tell from what you posted
(the javascript interpreter in my head doesn't report any errors, but
the one in my browser is better).  Are all the inputs numbers (not
strings)?

>
>        var cor_x = '<?php echo $_GET['x']; ?>';
>         var cor_y = '<?php echo $_GET['y']; ?>';
>         var zoom = '<?php echo $_GET['zoom']; ?>';
>
>         function initialize() {
>       if (GBrowserIsCompatible()) {
>         map = new GMap2(document.getElementById("map_canvas"));
>                 map.addControl(new GSmallMapControl());
>                 map.setCenter(new GLatLng(cor_x, cor_y));
>                 map.setMapType(G_NORMAL_MAP);
>                 map.setZoom(zoom);
>                .....
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to