On Dec 30, 4:15 pm, kathb4 <[email protected]> wrote:
>
> Works great. But now I want to combine the two.  What I want to do now
> is, when a user clicks to hide region 1, all markers in the polygon of
> region 1 are hidden as well.
>
> But for the life of me I have been unable to do this. I want to do
> this on the client side.  Note they are in different files and
> unrelated in any way other than geographically.  IE the markers in the
> arker file don't "know" what region they are in.

I would suggest that it's crucial for each marker to know what region
it's in.

One way of doing that would be to load the polygons first, and then to
load the markers. As you load each marker, find which polygon it's in
(use Mike's EPoly extension, it has a Contains method) and then assign
a custom property to the marker denoting the polygon:
marker.regionId=1, or whatever.

Then when polygon 1 is hidden or shown, you can loop though the
markers and hide or show markers with a matching regionId, together
with the corresponding sidebar entry if desired.

Andrew

--

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