 <p>To clear the markers, do this (set their map property to null):</p> <pre><code>for (var i=0;i&lt;gmarkers.length;i++){ gmarkers[i].setMap(null); } </code></pre> <p><a href="http://jsfiddle.net/pYy4B/1/" rel="nofollow">updated fiddle</a></p>