Something happened to my google map api script

I've been doing mobile part of my project after "completing" the web part. I'm using google map api. I have coded following:

function codeAddress() {


              var image = 'images/tickmark1.png';
              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 markerZad = new google.maps.Marker({
                      map: map,
                      position: results[0].geometry.location,
                      title: "NEW TASK",
                      icon: image
                  });
                  document.getElementById('latitude').value =results[0].geometry.location.nb.toPrecision(9);
                  document.getElementById('longitude').value=results[0].geometry.location.ob.toPrecision(9);
                  document.getElementById('adrs').value=document.getElementById('address').value;
                  document.getElementById('latit').value =results[0].geometry.location.nb.toPrecision(9);
                  document.getElementById('longit').value=results[0].geometry.location.ob.toPrecision(9);
                  alert("Ustalono wspolrzedne nowego zadania. Wybierz pracownika \n (PPM usuwa znacznik)");
                } else {
                  alert('Geocode was not successful for the following reason: ' + status);
                }
              google.maps.event.addListener(markerZad, 'click', function() {
                alert("Nowe zadanie: \n"+ address +  "\n"+"Wybierz pracownika \n (PPM usuwa znacznik)");
                map.setZoom(14);
                map.setCenter(this.getPosition());
              });
              google.maps.event.addListener(markerZad, 'rightclick', function() {
                markerZad.setMap(null);

                document.getElementById('latitude').value =0;
                document.getElementById('longitude').value=0;
                document.getElementById('adrs').value=0;
                document.getElementById('latit').value =0;
                document.getElementById('longit').value=0;
                document.getElementById('ajdideva').value="X";
                document.getElementById('iddev').value=0;
                document.getElementById('baton').disabled=true;
                alert("Usunieto znacznik. Wpisz inny adres.");
              });

            });

    }

Let's leave behind the level of this code. I'm sure it's a bad one. But the thing is...it used to work for me like few days ago. Now it doesn't. And yes, I haven't touched it since then... I figured out myself, that the problem causes "results". I get status==OK, then it places a marker in a correct spot, and then...nothing happens. I mean my inputs in html file don't get their values changed and +listeners aren't working. When I changed "results[0]." etc to simple string, it worked, that's why I think that there's a problem with results[0]. Any suggestions please?


Don't access undocumented properties like e.g. results[0].geometry.location.nb . The names of these properties may(and will) change. To access the values of these properties use the documented methods, e.g. lat() to access the latitude of a LatLng-instance:

document.getElementById('latitude').value 
    = results[0].geometry.location.lat().toPrecision(9);