function removeMarkers() { for (i = 0; i < markers.length; i++) { markers[i].setMap(null); } markers = []; }