title: Push new LatLng in Google Maps
body: <p>I'm trying to push into an arry in which I have all the latlng coordinates of some markers from user input (text field), but I'm having some troubles, since new data it's not pushed into the array. Does anyone knows what I'm doing wrong?</p>
  
  <p>here's my code:</p>
  
  <pre><code>var locations = [
  new google.maps.LatLng(0.0,0.0),
  ];
  
  var map;
  function initialize() 
  {
  var myLatlng = new google.maps.LatLng(0.0,0.0);
  var myOptions = 
  {
  zoom: 4,
  center: myLatlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP
  }
  
  map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  
      var marker, i;
  
      for (i = 0; i &lt; locations.length; i++) {  
        marker = new google.maps.Marker({
          position: locations[i],
          map: map
        });
      }
  }
  
  function add_item(){
  var item = document.frm.inputbox.value;
  locations.push(item);
  document.frm.outputbox.value = locations;
  }
  </code></pre>
  
  <p>and in the body I have the map div and the two input boxes:</p>
  
  <pre><code>&lt;div id="map_canvas" style="width:750; height:500"&gt;&lt;/div&gt;
  
  &lt;form name="frm"&gt;
  Input&lt;input type="text" name="inputbox" value=""/&gt;
  Output&lt;input type="text" name="outputbox" value=""/&gt;
  &lt;input type="button" onClick="add_item(); initialize();" value="Push"/&gt;
  </code></pre>
  
  <p>The function add_item isn't working as I would like it to do though..  the result of add_item is an array with "(0.0,0.0),NEWITEM", so it deletes "new google.maps.LatLng" from the locations variable values. The problem is that I really need the new google.maps.LatLng part, so I would need that the new item is added as a new line inside the brackets []...
  But I have no ideas...</p>