Do you mean invoking that function before setZoom() ?

I did so but in this case, the auto-zoom,auto-position stopped worked
that was working before using getMaxZoomAtLatLng()

Below my function

function VWGM_AutoPositionAndZoom(){
        //collect all visible markers on map and create bounds collection
based on each marker point on map and then set the position of map and
zoom level that enables best view on all visible markers.

        var bounds = new GLatLngBounds();

        for (var i = 0; i < gmarkers.length; i++) {
          if(!gmarkers[i].isHidden()){
                  var point = gmarkers[i].getPoint();
                  bounds.extend(point);
          }
        }

        // Position map at centre of bounds
        // and set zoom to include include them all
        map.getMaxZoomAtLatLng(bounds);
        map.setZoom(map.getBoundsZoomLevel(bounds));
        map.setCenter(bounds.getCenter());
}

Am i doing something wrong ?

On 15 Ekim, 10:53, Mike Williams <[email protected]> wrote:
> After performing the calculation and determining the centre, you can
> call GMapType.getMaxZoomAtLatLng(centre). [Although getMaxZoomAtLatLng
> is only documented to work for Satellite and Hybrid map types, it's
> recently been upgraded to also work for Normal, Physical and
> Satellite_3D map types.]
>
> Use whichever is lower of maptype.getMaxZoomAtLatLng and
> map.getBoundsZoomLevel
>
> --
> Mike Williamshttp://econym.org.uk/gmap
--~--~---------~--~----~------------~-------~--~----~
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