Hi,

I had a similar issue recently.

I decided that when adding a marker, I would add a custom 'category'
piece to the marker object 'marker.category' which allows me to figure
out which to show or hide.

I have loops which go through all the markers asking "are you of the
selected category" and if it is, then it gets hidden.

It can be seen in action at 
http://www.karaokemagik.co.uk/events/2010/1/29/karaoke+night/
(as long as the date you look at it is not beyond the 29th January
2010, when the map element becomes redundant).

The code for it is at http://www.karaokemagik.co.uk/static/gmaps.js.php?event=10
(the event number is needed to get the longlat coords). With the
pieces that will most be of benefit to you being just under the
initialising stuff near the top of the file. toggleFood, togglePetrol,
toggleTaxi.

Basically, when triggered, it checks to see if the markers are already
loaded via a simple check variable, if they are not then it loads
them. If they are loaded/after it has loaded them, it then asks if
they are visible, if they are, then hide them, if they are not, then
show them.

hth

--

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