Click here to read about this example in my blog

Dynamically Toggle Markers in Google Maps

In this example the MarkerManager is used to put the markers on the map. There's no problem hiding the markers but if you first hide them and then zoom the map, all markers are suddenly visible again. But don't worry, there's a fix for this, as seen in this example.