title: GoogleMaps v3 API Create only 1 marker on click
body: <p>I am successfully creating a marker on click however, using the following code, I get a new marker with every click, I only ever want one marker added and if someone clicks more than once I would like it to move the existing marker to the new position Can anyone help here is the code</p>
  
  <pre><code> function placeMarker(location) {
          var clickedLocation = new google.maps.LatLng(location);
          var marker = new google.maps.Marker({
              position: location,
              map: map
          });
      }
  
  google.maps.event.addListener(map, 'click', function(event) {
          placeMarker(event.latLng);
  </code></pre>