title: how can remove the last marker google maps v3
body: <p>I have a html form for adding new places in my data ,</p>
  
  <p>I want the user add marker and delete last marker , </p>
  
  <p>I found this code but it is added more than one marker</p>
  
  <p>How can make it delete the last one?</p>
  
  <p>because I need just one marker? this is the demo of form <a href="http://saudi-hotels.info/add_hotel.php" rel="nofollow">http://saudi-hotels.info/add_hotel.php</a></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  var map;
  function mapa()
  {
      var opts = {'center': new google.maps.LatLng(26.12295, -80.17122), 
      'zoom':11, 'mapTypeId': google.maps.MapTypeId.ROADMAP }
  
      map = new google.maps.Map(document.getElementById('mapdiv'),opts);
  
                  google.maps.event.addListener(map,'click',function(event) {
  
                          document.getElementById('long').value = event.latLng.lng();
                          document.getElementById('lat').value = event.latLng.lat();
  
                      marker = new google.maps.Marker({
                              map: map,
                              position: new google.maps.LatLng(event.latLng.lat(),event.latLng.lng()),
                    });
  
                    }
  
  
  );
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>please help me , </p>