Hello all,

I have more or less map similar with below example.Only in my case
each checkbox is showing/hiding a group of markers not single as in
the below example.

http://www.geocodezip.com/v2_MarkerCheckBoxes.asp

My problem is after each click on any of the checkbox i invoke a
function which should center the map according to visible markers and
set best zoom level for all of them..

my function is :

function VWGM_AutoPositionAndZoom(){

        var bounds = new GLatLngBounds();

        for (var i = 0; i < gmarkers.length; i++) {
                 var point = gmarkers[i].getPoint();

                 bounds.extend(point);
        }

        map.setZoom(map.getBoundsZoomLevel(bounds));
        map.setCenter(bounds.getCenter());
}

But this function only sets zoom level 2 in all cases (default zoom
level is 7) and set the position always somewhere in the middle that
makes view all markers at a once look.But what i am in need of is not
this actually, i want auto zoom in for example in case only two
markers visible on map then i expect to get zoomed only on these
markers closely with centralized position.

I have researched enough and tried many things but in all ways i got
the same result which is a map zoom level set to 2 in all cases and
makes the view on markers very far neverthless how many markers and
where their positions are..

And my own case is on below link:

http://otb.vw01.starsale.nl/bin/ibp.jsp?ibpDispWhat=zone&ibpPage=S1_FocusPage&ibpDispWho=S1_Bedrijven&mode=map&ibpZone=S1_Bedrijven&ibpDisplay=view&;

Hope you understand what i meant.

Any help will be much appreciated.

Thank you.

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