title: Avoid geocoder.geocode in Google maps and use variable to pass to google.maps.Marker
body: <p>I'm using google maps api version 3 in one of my projects and it's working properly. 
  I use this function to set a marker to point customer address. </p>
  
  <pre><code>function codeAddress() {
      var address = 'ulitsa "Dimcho Debelyanov" 3, Sofia, Bulgaria';
      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
              });
              map.setZoom(16);
          } else {
              alert('Geocode was not successful for the following reason: ' + status);
          }
      });
  }
  </code></pre>
  
  <p>But sometimes request to geocoder is not success and marker is not constructed. 
  I have tried to hardcode results array into variable (result from results.toSource() ) 
  and pass direct into </p>
  
  <pre><code>            var marker = new google.maps.Marker({
                  map: map,
                  position: results[0].geometry.location
              });
  </code></pre>
  
  <p>But this not working properly because .toSource keep only variables. I receive following error: 
  <code>InvalidValueError: setCenter: not a LatLng or LatLngLiteral: in property lat: not a number</code>
   I think google.maps.Marker expected object as an argument. 
  When I reveal object into debugger I saw that it received several methods from prototype chain:</p>
  
  <pre><code>__proto__: Q
  b: function (a){return a?Md(this.lat(),a.lat())&amp;&amp;Md(this.lng(),a.lng()):!1}
  constructor: function Q(a,b,c){a-=0;b-=0;c||(a=Kd(a,-90,90),180!=b&amp;&amp;(b=Ld(b,-180,180)));this.nb=a;this.ob=b}
  equals: function (a){return a?Md(this.lat(),a.lat())&amp;&amp;Md(this.lng(),a.lng()):!1}
  lat: function (){return this[a]}
  lng: function (){return this[a]}
  toString: function (){return"("+this.lat()+", "+this.lng()+")"}
  toUrlValue: function (a){a=Sd(a)?a:6;return We(this.lat(),a)+","+We(this.lng(),a)}
  __proto__: Object 
  </code></pre>
  
  <p>So If i put <code>lat: function (){return this[a]}</code> into object this is not be enough. 
  The problem is interested. I'm searching ideas how to solve the problem. </p>
  
  <p>I would appreciate any idea and help.</p>
  
  <p>After good answer from Hollister I have rewrite my code to this 
  function avoid geocoder entirely (I get latitide and longtitude from geocoder 
  response).</p>
  
  <pre><code>    function createGoogleMap() {
          var map, latlng = new google.maps.LatLng(42.67218039999999, 23.354384200000027);
          var mapOptions = {
              zoom: 16,
              center: latlng,
              mapTypeId: google.maps.MapTypeId.ROADMAP, 
          }
  
          map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
          var marker = new google.maps.Marker({
              map: map,
              position: latlng,
              title: 'улица „Димчо Дебелянов“ 3, 1113 София, България'
          });
      }
      google.maps.event.addDomListener(window, 'load', createGoogleMap);
  </code></pre>
  
  <p>May be this help someone with similar problem. </p>