title: multiple marker placing in google map api using jquery where coords will be from database
body: <p>I am using below code to mark multiple marker on google map using Google Map API JS </p>
  
  <p>I am pushing json data to locations array .</p>
  
  <p>JSON have coordinates </p>
  
  <blockquote>
    <p>18.53515053 73.87944794 and 18.53640175 73.88206482</p>
  </blockquote>
  
  <p>and when I request data using array it is giving me the correct result.</p>
  
  <p>when I pushed data to locations array it is giving me</p>
  
  <blockquote>
    <p>Array [ "18.53515053", "73.87944794", "18.53640175", "73.88206482" ]</p>
  </blockquote>
  
  <p>but I want below type of result</p>
  
  <pre><code>var locations = [[18.53515053, 73.87944794], [18.5670762, 73.9084194]]
  </code></pre>
  
  <p>Please help me               </p>
  
  <pre><code>function multimarker(map)
  {
          jQuery.ajax({                              
      url: baseurl +  "getdriverlocation.php",
      type: "JSON",
      async: false,
      success: function(data){
         var myArray = jQuery.parseJSON(data);// instead of JSON.parse(data)
  
          jQuery(myArray).each(function( index, element ) {     
          driverlat = element.driver_lat;
          driverlng = element.driver_lng;
          locations.push(driverlat , driverlng)
  });
  
      alert (locations)
  } 
  });
    for (i  = 0; i &lt; locations.length; i++)
                   { 
                   alert(    locations[i][0]);
                  var latlng1 = new google.maps.LatLng(locations[i][0], locations[i][1]);
              drivermarker=new google.maps.Marker({position:latlng1});
              drivermarker.setMap(map);
             var infowindow = new google.maps.InfoWindow();
             google.maps.event.addListener(drivermarker, 'click', (function(marker, i) {
              return function() {
            infowindow.setContent(locations[i][0]);
            infowindow.open(map, drivermarker);
  
          }
        })(drivermarker, i));
                   }
  
  }
  </code></pre>