title: Google Maps API JS: trying to convert the address to Lat Long
body: <p>JavaScript Google Maps API V3</p>
  
  <p>I'm trying to convert the address to Latitude/Longitude using <code>geocode</code> from Google Maps API v3 but it's not working.</p>
  
  <p>The rest of the code is working fine.</p>
  
  <p>I'm sure this a very simple problem !!</p>
  
  <p>the code </p>
  
  <pre><code>        var map;
      function initialize() {
              var infoWindow = new google.maps.InfoWindow;
              var myLatLng = new google.maps.LatLng(-23.000516, -43.413473);
              var myOptions = {
                  zoom: 15,
                  center: myLatLng,
                  mapTypeId: google.maps.MapTypeId.ROADMAP
              };
  
      map = new google.maps.Map(document.getElementById('mapa'), myOptions);
  
          // Download do XML
          downloadUrl("http://podium.pvidesign.com.br/mapa/casas.xml", function(data) {
              var icone = 'http://podium.pvidesign.com.br/mapa/imagens/casa.png';
              var imoveis = data.documentElement.getElementsByTagName("imovel");
                  for (var i = 0; i &lt; imoveis.length; i++) {
                      //var latlng = new google.maps.LatLng(parseFloat(imoveis[i].getAttribute("lat")), parseFloat(imoveis[i].getAttribute("lng")));
                      var logradouro = imoveis[i].getAttribute("logradouro");
                      var endereco = imoveis[i].getAttribute("endereco");
                      var numero = imoveis[i].getAttribute("numero");
                      var bairro = imoveis[i].getAttribute("bairro");
                      var cidade = imoveis[i].getAttribute("cidade");
                      var imagem = imoveis[i].getAttribute("img");
                      var end_completo = logradouro + " " + endereco + ", " + numero + ", " + bairro + ", " + cidade;
                      var nome = imoveis[i].getAttribute("nome");
                      var desc = imoveis[i].getAttribute("desc");
                      var html = "&lt;b&gt;" + nome + "&lt;/b&gt;&lt;br&gt;" + "&lt;img src='" + imagem + "'&gt;&lt;br&gt;" + desc + "&lt;br&gt;" + end_completo;
  
                      // Coletando Lat e Long atraves do endereço
                      var geocoder = new google.maps.Geocoder();
                      geocoder.geocode( {'address': end_completo}, function(results, status) {
  
                              var latLong = results[0].geometry.location;
  
                      }); // Fim Coletando
  
                      var houseMarker = new google.maps.Marker({
                          title:nome,
                          position:latLong,
                          map:map,
                          icon:icone
                      });
                  bindInfoWindow(houseMarker, map, infoWindow, html);
                  } 
              }); 
  
          // Balão de informação
          function bindInfoWindow(houseMarker, map, infoWindow, html) {
              google.maps.event.addListener(houseMarker, 'mouseover', function() {
              infoWindow.setContent(html);
              infoWindow.open(map, houseMarker);
              });
              google.maps.event.addListener(houseMarker, 'mouseout', function() {
              infoWindow.close();
              });
          };
  
      }; 
  </code></pre>