title: Display the Latitude and Longitude of a searched address on my sites Google-Map using API
body: <p>I have a section on a website I am developing where the user can input their address into the Google Geocode Api and their homes location is displayed, once the map is displayed the marker cannot be moved neither does the right click bring up the "What's Here" option.</p>
  
  <p>What I am actually trying to get as well as the map view are the co-ordinates for that address ideally with the ability to allow the user to fine tune the marker to lets say the front entrance porch and have the Latitude and Longitude displayed either on the screen or inside of an input field.</p>
  
  <p>Thanks for looking at this for me, I know very little about Javascript programming and greatly appreciate any help that you can offer.</p>
  
  <p>Kind Regards 
  Ian.</p>
  
  <p>The basic code I've used so far is below:</p>
  
  <pre><code>&lt;script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;signed_in=true"&gt;           &lt;/script&gt;
  
  &lt;script&gt;
  var geocoder;
  var map;
  function initialize() {
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(51.915892, -0.660751);
    var mapOptions = {
      zoom: 18,
      center: latlng
    }
    map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  }
  
  function codeAddress() {
    var address = document.getElementById('address').value;
    geocoder.geocode( { 'address': address}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({
            map: map,
            position: results[0].geometry.location
        });
      } else {
        alert('Geocode was not successful for the following reason: ' + status);
  }
    });
  }
  
  google.maps.event.addDomListener(window, 'load', initialize);
  &lt;/script&gt;
  </code></pre>