Wednesday, October 14, 2009

Re: Auto zoom and center map problem

Thanks for fast reply.

I have added a control that skips entries with lat/lon (0,0) when
filling bounds array.Now the zoom level is set to 4 in all cases in
place of 2 as how it was before.And also if you click on last cluster
(Toelevering en dienstverlening), the marker is located on iceland but
the zoom level and position of map is not set automatically to see the
marker on iceland properly..only a small part of it is visible..

I can re-create the markers when any of them are matching with the
selected cluster but i dont have a cluer before re-create the marker
how destroy the existing one instead of hiding it as how i am doing
currently ?

On Oct 14, 4:09 pm, Marcelo <marcelo...@hotmail.com> wrote:
> You're showing and hiding markers, but the gmarkers array that you're
> using to calculate the bounds always has the same content, regardless
> of whether markers are visible or not.
>
> Also, you have a lot of entries with lat/lon (0,0):http://otb.vw01.starsale.nl/bin/Modules/VWGM/elementsDataXml.jsp
> so there's always some markers off the coast of Africa which extend
> your bounds.
>
> I'd suggest creating a separate array of markers for each checkbox, or
> a 2-dimentional array, like markers[checkboxIndex][markerIndex]
>
> --
> Marcelo -http://maps.forum.nu
> --
>
> On Oct 14, 2:49 pm, Umut Tuncdemir <cam...@gmail.com> wrote:
>
> > 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_F...
>
> > 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 google-maps-api@googlegroups.com
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate