MarkerClusterer again ;-)

350 views
Skip to first unread message

Poivre2

unread,
Mar 22, 2010, 8:01:04 AM3/22/10
to Google Maps JavaScript API v3
Dear all,

I use MarkerClusterer on my real estate map to display ads. I'm
currently building an AJAX interface so that users can filter ads
dynamically using a form.

I show or hide ads (visibility) based on those filters. My problem is
that MarkerClusterer does not take into account the visibility status
of markers. How can I include that in MarkerClusterer and update the
Cluster rendering when a filter changes?

Here is my test page (in French ...) :
http://www.ruedelimmobilier.com/ng/annonces_immobilieres.php

Thank you very much for your help!
Regards
Samuel

Poivre2

unread,
Mar 28, 2010, 7:05:16 AM3/28/10
to Google Maps JavaScript API v3
Here is the answer from Luke Mahe which solved my problem :

"The MarkerClusterer sets all markers map to be null because it
doesn't need a marker to be attached to a map and this also improves
performance. I would suggest that you take a different approach and
keep an array of all your markers and then when you change your filter
go though your marker array and create a new array of those who match
your filter, then you can clear out the markers in the MarkerClusterer
and pass in the new array that you have."

Thanks again Luke !

On 22 mar, 14:01, Poivre2 <guina...@gmail.com> wrote:
> Dear all,
>
> I useMarkerClustereron my real estate map to display ads. I'm


> currently building an AJAX interface so that users can filter ads
> dynamically using a form.
>
> I show or hide ads (visibility) based on those filters. My problem is

> thatMarkerClustererdoes not take into account the visibility status
> of markers. How can I include that inMarkerClustererand update the

Reply all
Reply to author
Forward
0 new messages