title: get address after clicking in the map
body: <p>I need to get address and coordinates after clicking on the map, I'm using google map api v3, i recuperated the coordinates in inputs but i need also arddress of the point.</p>
  
  <pre><code> function initialize() {
              var myOptions = {
                  center: new google.maps.LatLng(36.835769, 10.247693 ),
                  zoom: 15,
                  mapTypeId: google.maps.MapTypeId.ROADMAP
              };
              var map = new google.maps.Map(document.getElementById("map_canvas"),
              myOptions);
              google.maps.event.addListener(map, 'click', function(event) {
                  placeMarker(event.latLng);
              });
  
              var marker;
              function placeMarker(location) {
                  if(marker){ //on vérifie si le marqueur existe
                      marker.setPosition(location); //on change sa position
                  }else{
                      marker = new google.maps.Marker({ //on créé le marqueur
                          position: location, 
                          map: map
                      });
                  }
                  latitude.value=location.lat();
                  longitude.value=location.lng();
              }
  
          }
  </code></pre>
  
  <p>I used this php script to get the address but if don't know how to use it in javascript?
  Can i use javascript to get address?</p>
  
  <pre><code>&lt;?php
      $url      = 'http://where.yahooapis.com/geocode?location=40.714224,-73.961452&amp;gflags=R&amp;flags=J';
      $response = json_decode(file_get_contents($url));
      $location = $response-&gt;ResultSet-&gt;Results[0];
      foreach ((array) $location as $key =&gt; $value) {
              if($key == 'city')
                  $city = $value;
              if($key == 'country')
                  $country = $value;
              if($key == 'street')
                  $street = $value;
      }
      echo "Street: ".$street."&lt;br&gt;";
      echo "City: ".$city;
      echo "&lt;br/&gt;Country: ".$country;
  
      ?&gt;
  </code></pre>