window.Location = (function() {
    function Coordinates(geometry) {
        this.latitude = geometry.location.lat();
        this.longitude = geometry.location.lng();
    }
    Coordinates.prototype.toString = function() {
        return Number(this.latitude.toFixed(6)) + ',' + Number(this.longitude.toFixed(6));
    }

    function Types(types) {
        for (var i = 0; i < types.length; i++) {
            if (types[i] !== 'political') {
                this.push(types[i]);
            }
        }
    }
    Types.prototype = new Array();
    Types.prototype.toString = function() {
        return this.join(' ');
    }

    function Component(component) {
        this.long_name = component.long_name;
        this.short_name = component.short_name;
        this.types = new Types(component.types);
    }
    Component.prototype.toString = function() {
        var str = this.long_name;

        if ('' !== this.short_name && this.long_name !== this.short_name) {
            str += ' (' + this.short_name + ')';
        }

        return str;
    }

    function City(component) {
        Component.call(this, component);
    }
    City.prototype = Object.create(Component.prototype);

    function District(component) {
        Component.call(this, component);
    }
    District.prototype = Object.create(Component.prototype);

    function StreetName(component) {
        Component.call(this, component);
    }
    StreetName.prototype = Object.create(Component.prototype);

    function StreetNumber(component) {
        Component.call(this, component);
    }
    StreetNumber.prototype = Object.create(Component.prototype);

    function Region(component) {
        Component.call(this, component);
    }
    Region.prototype = Object.create(Component.prototype);

    function County(component) {
        Component.call(this, component);
    }
    County.prototype = Object.create(Component.prototype);

    function Country(component) {
        Component.call(this, component);
    }
    Country.prototype = Object.create(Component.prototype);

    function Zipcode(component) {
        Component.call(this, component);
    }
    Zipcode.prototype = Object.create(Component.prototype);

    function Location(result) {
        this.formatted_address = result.formatted_address;
        this.coordinates = new Coordinates(result.geometry);
        this.types = new Types(result.types);

        for (var component in result.address_components) {
            var cmpt = result.address_components[component];
            for (var type in cmpt.types) {
                switch (cmpt.types[type]) {
                    case 'locality':
                        this.city = new City(cmpt);
                        break;
                    case 'sublocality':
                        this.district = new District(cmpt);
                        break;
                    case 'street_number':
                        this.street_number = new StreetNumber(cmpt);
                        break;
                    case 'route':
                        this.street_name = new StreetName(cmpt);
                        break;
                    case 'administrative_area_level_1':
                        this.region = new Region(cmpt);
                        break;
                    case 'administrative_area_level_2':
                        this.county = new County(cmpt);
                        break;
                    // case 'administrative_area_level_3':
                    //     this.something = new What(cmpt);
                    //     break;
                    case 'country':
                        this.country = new Country(cmpt);
                        break;
                    case 'postal_code':
                        this.zipcode = new Zipcode(cmpt);
                        break;
                }
            }
        }

        this.name = (this.city
            || this.district
            || this.county
            || this.region
            || this.country
        ).long_name;
    }

    Location.prototype.toString = function() {
        return this.formatted_address;
    }

    return Location;
})();

@@ -21,24 +21,57 @@
 unction() %7B%0A
+    //%0A    // Coordinates%0A    //%0A
     function
@@ -340,32 +340,59 @@
 xed(6));%0A    %7D%0A%0A
+    //%0A    // Types%0A    //%0A
     function Typ
@@ -448,24 +448,73 @@
 gth; i++) %7B%0A
+            // don't care about 'political' type%0A
             
@@ -721,32 +721,63 @@
 in(' ');%0A    %7D%0A%0A
+    //%0A    // Component%0A    //%0A
     function Com
@@ -1199,1147 +1199,33 @@
     
-function City(component) %7B%0A        Component.call(this, component);%0A    %7D%0A    City.prototype = Object.create(Component.prototype);%0A%0A    function District(component) %7B%0A        Component.call(this, component);%0A    %7D%0A    District.prototype = Object.create(Component.prototype);%0A%0A    function StreetName(component) %7B%0A        Component.call(this, component);%0A    %7D%0A    StreetName.prototype = Object.create(Component.prototype);%0A%0A    function StreetNumber(component) %7B%0A        Component.call(this, component);%0A    %7D%0A    StreetNumber.prototype = Object.create(Component.prototype);%0A%0A    function Region(component) %7B%0A        Component.call(this, component);%0A    %7D%0A    Region.prototype = Object.create(Component.prototype);%0A%0A    function County(component) %7B%0A        Component.call(this, component);%0A    %7D%0A    County.prototype = Object.create(Component.prototype);%0A%0A    function Country(component) %7B%0A        Component.call(this, component);%0A    %7D%0A    Country.prototype = Object.create(Component.prototype);%0A%0A    function Zipcode(component) %7B%0A        Component.call(this, component);%0A    %7D%0A    Zipcode.prototype = Object.create(Component.prototype);%0A
+//%0A    // Location%0A    //
 %0A   
@@ -1705,19 +1705,24 @@
  = new C
-ity
+omponent
 (cmpt);%0A
@@ -1840,15 +1840,16 @@
 new 
-Distric
+Componen
 t(cm
@@ -1979,20 +1979,17 @@
 new 
-StreetNumber
+Component
 (cmp
@@ -2108,18 +2108,17 @@
 new 
-StreetName
+Component
 (cmp
@@ -2254,14 +2254,17 @@
 new 
-Region
+Component
 (cmp
@@ -2398,20 +2398,23 @@
 = new Co
-u
+mpone
 nt
-y
 (cmpt);%0A
@@ -2555,11 +2555,16 @@
 new 
-Wha
+Componen
 t(cm
@@ -2683,21 +2683,23 @@
 = new Co
-untry
+mponent
 (cmpt);%0A
@@ -2816,15 +2816,17 @@
 new 
-Zipcode
+Component
 (cmp
@@ -3068,25 +3068,24 @@
 name;%0A    %7D%0A
-%0A
     Location

Remove useless objects