title: Matrices in Javascript
body: <p>well I'm beginner on google map v3, so my problem now is how to add multiple markers on map when I click on a button that I put on the map. When I filled the matrice manually, the multiple markers are shown on the map but if I use variables from database only the last longitude and latitude are shown on map :(
  this is my javascript code :</p>
  
  <pre><code>//loading longitude and latitude from database
  for(var i=0;i&lt;len;i++){
  
         var locations = [[results.rows.item(i).lat,results.rows.item(i).long]];           
   }
  
  
  
  //click event
         google.maps.event.addDomListener(myControl, 'click', function() {
  
  for(var i=0;i&lt;len;i++){
  
  //creation of markers on map
        var marker = new google.maps.Marker({
        position: new google.maps.LatLng(locations[i][0], locations[i][1]),
        map: map,
        title: "num:"+i,
  
  
    });}
  
  
    });
  </code></pre>