title: Get User Address By Drag & Drop marker on Google Maps
body: <p>I have a map on my website, in which i have to get user address by just dragging &amp; drop marker onto any place on map. I have successfully display a map on my website. But i have no idea of How to Show that marker on map which can be dragged &amp; get User addess by that. I have below code of maps which is getting user address by clicking on map. Thanks.</p>
  
  <pre><code>&lt;div id='map-canvas'&gt;&lt;/div&gt;
  
  var myLatlng = new google.maps.LatLng(latitude,longitude);
  var myOptions = {
    zoom: 10,
    center: myLatlng
  }
  
  var map = new google.maps.Map(document.getElementById("map-canvas"), myOptions);
  var geocoder = new google.maps.Geocoder();
  
  google.maps.event.addListener(map, 'click', function(event) {
    geocoder.geocode({
      'latLng': event.latLng
    }, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        if (results[0]) {
          alert(results[0].formatted_address);
        }
      }
    });
  });
  </code></pre>