jquery.geocomplete.js
function(result){

      var data = {},
        geometry = result.geometry,
        viewport = geometry.viewport,
        bounds = geometry.bounds;

      // Create a simplified version of the address components.
      $.each(result.address_components, function(index, object){
        var name = object.types[0];

        $.each(object.types, function(index, name){
          data[name] = object.long_name;
          data[name + "_short"] = object.short_name;
        });
      });

      // Add properties of the places details.
      $.each(placesDetails, function(index, key){
        data[key] = result[key];
      });

      // Add infos about the address and geometry.
      $.extend(data, {
        formatted_address: result.formatted_address,
        location_type: geometry.location_type || "PLACES",
        viewport: viewport,
        bounds: bounds,
        location: geometry.location,
        lat: geometry.location.lat(),
        lng: geometry.location.lng()
      });

      // Set the values for all details.
      $.each(this.details, $.proxy(function(key, $detail){
        var value = data[key];
        this.setDetail($detail, value);
      }, this));

      this.data = data;
    }
function(result){

      var data = {},
        geometry = result.geometry,
        viewport = geometry.viewport,
        bounds = geometry.bounds;

      // Create a simplified version of the address components.
      $.each(result.address_components, function(index, object){
        var name = object.types[0];

        $.each(object.types, function(index, name){
          data[name] = object.long_name;
          data[name + "_short"] = object.short_name;
        });
      });

      // Add properties of the places details.
      $.each(placesDetails, function(index, key){
        data[key] = result[key];
      });

      // Add infos about the address and geometry.
      $.extend(data, {
        formatted_address: result.formatted_address,
        location_type: geometry.location_type || "PLACES",
        viewport: viewport,
        bounds: bounds,
        location: geometry.location,
        lat: geometry.location.lat(),
        lng: geometry.location.lng()
      });

      // Set the values for all details.
      $.each(this.details, $.proxy(function(key, $detail){
        var value = data[key];
        this.setDetail($detail, value);
      }, this));

      this.data = data;
    }
function ( result ) { var data = { } , geometry = result . geometry , viewport = geometry . viewport , bounds = geometry . bounds ; // Create a simplified version of the address components. $ . each ( result . address_components , function ( index , object ) { var name = object . types [ 0 ] ; $ . each ( object . types , function ( index , name ) { data [ name ] = object . long_name ; data [ name + "_short" ] = object . short_name ; } ) ; } ) ; // Add properties of the places details. $ . each ( placesDetails , function ( index , key ) { data [ key ] = result [ key ] ; } ) ; // Add infos about the address and geometry. $ . extend ( data , { formatted_address : result . formatted_address , location_type : geometry . location_type || "PLACES" , viewport : viewport , bounds : bounds , location : geometry . location , lat : geometry . location . lat ( ) , lng : geometry . location . lng ( ) } ) ; // Set the values for all details. $ . each ( this . details , $ . proxy ( function ( key , $detail ) { var value = data [ key ] ; this . setDetail ( $detail , value ) ; } , this ) ) ; this . data = data ; }
Populate the provided elements with new `result` data. This will lookup all elements that has an attribute with the given component type.
Populate the provided elements with new result data . This will lookup all elements that has an attribute with the given component type .