> Here my work (http://cga-3.hmdc.harvard.edu/sc/).

The screen layout is bit broken in FF2 but I can just see the
'hospital' checkbox to try it


> I am using the bounds_changed event to limit the info added into the
> side div.
> It works but when I check the layer on/off, I can not see it again
> unless
> I pan the map view and change again the  bounds_changed.


That's what you have written your code to do ; checking the unchecked
'hospital' box calls addHospital(), but all that does is set up a
listener for bounds_changed.

If you move the map later, it triggers bounds_changed and *then* the
code to fetch JSON and create hospital markers is run.

I don't see what purpose there is in doing it that way; presumably you
want to run the marker add code immediately.
You might reconsider the strategy altogether.
Fetch your JSON data and build/rebuild an array of markers as
required, in your case on bounds changed.  Only put them on the map if
the box is checked.
When unchecking the box, remove the array of markers from the map.
When checking, place the current array of markers on the map.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to