title: Add multiple markers with Google Maps API v3
body: <p>I have the following function to add one single marker but I want to add multiple markers by clicking on the map. I have Googled but I can't get any straight answer on how I can solve this problem.</p>
  
  <pre><code>function placeMarker(location) {
      if(marker) {
          marker.setPosition(location);
      } else {
          marker = new google.maps.Marker({
              position: location,
              map: gm_map,
              draggable: true
          });
      }
  }
  </code></pre>
  
  <p>I know I need to use <code>Array()</code> but I don't know exactly how. How can I solve my problem?</p>
  
  <p><strong>DEMO</strong>: removed because the problem has been solved.</p>