I had an interesting scenario where I had to clear the markers on a google map. It was quite easy to do in Google Maps API v2. But in API v3 it is not straight forward.
Whenever you create new markers you need to push them into an array. When you need to clear the markers just loop through the array with the markers and remove them.