UNPKG

universal-geocoder

Version:

Universal geocoding abstraction server-side and client-side with multiple built-in providers

188 lines 10 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import Geocoded from "../../Geocoded"; var GoogleMapsGeocoded = /** @class */ (function (_super) { __extends(GoogleMapsGeocoded, _super); function GoogleMapsGeocoded(_a) { var placeId = _a.placeId, partialMatch = _a.partialMatch, types = _a.types, precision = _a.precision, streetAddress = _a.streetAddress, intersection = _a.intersection, political = _a.political, colloquialArea = _a.colloquialArea, ward = _a.ward, neighborhood = _a.neighborhood, premise = _a.premise, subpremise = _a.subpremise, naturalFeature = _a.naturalFeature, airport = _a.airport, park = _a.park, pointOfInterest = _a.pointOfInterest, establishment = _a.establishment, postalCodeSuffix = _a.postalCodeSuffix, subLocalityLevels = _a.subLocalityLevels, geocodedObject = __rest(_a, ["placeId", "partialMatch", "types", "precision", "streetAddress", "intersection", "political", "colloquialArea", "ward", "neighborhood", "premise", "subpremise", "naturalFeature", "airport", "park", "pointOfInterest", "establishment", "postalCodeSuffix", "subLocalityLevels"]); var _this = _super.call(this, geocodedObject) || this; _this.placeId = placeId; _this.partialMatch = partialMatch; _this.types = types; _this.precision = precision; _this.streetAddress = streetAddress; _this.intersection = intersection; _this.political = political; _this.colloquialArea = colloquialArea; _this.ward = ward; _this.neighborhood = neighborhood; _this.premise = premise; _this.subpremise = subpremise; _this.naturalFeature = naturalFeature; _this.airport = airport; _this.park = park; _this.pointOfInterest = pointOfInterest; _this.establishment = establishment; _this.postalCodeSuffix = postalCodeSuffix; _this.subLocalityLevels = subLocalityLevels || []; return _this; } GoogleMapsGeocoded.create = function (object) { return new this(object); }; GoogleMapsGeocoded.prototype.toObject = function () { return __assign(__assign({}, _super.prototype.toObject.call(this)), { placeId: this.placeId, partialMatch: this.partialMatch, types: this.types, precision: this.precision, streetAddress: this.streetAddress, intersection: this.intersection, political: this.political, colloquialArea: this.colloquialArea, ward: this.ward, neighborhood: this.neighborhood, premise: this.premise, subpremise: this.subpremise, naturalFeature: this.naturalFeature, airport: this.airport, park: this.park, pointOfInterest: this.pointOfInterest, establishment: this.establishment, postalCodeSuffix: this.postalCodeSuffix, subLocalityLevels: this.subLocalityLevels }); }; GoogleMapsGeocoded.prototype.withPlaceId = function (placeId) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { placeId: placeId })); }; GoogleMapsGeocoded.prototype.getPlaceId = function () { return this.placeId; }; GoogleMapsGeocoded.prototype.withPartialMatch = function (partialMatch) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { partialMatch: partialMatch })); }; GoogleMapsGeocoded.prototype.isPartialMatch = function () { return this.partialMatch; }; GoogleMapsGeocoded.prototype.withTypes = function (types) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { types: types })); }; GoogleMapsGeocoded.prototype.getTypes = function () { return this.types; }; GoogleMapsGeocoded.prototype.withPrecision = function (precision) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { precision: precision })); }; GoogleMapsGeocoded.prototype.getPrecision = function () { return this.precision; }; GoogleMapsGeocoded.prototype.withStreetAddress = function (streetAddress) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { streetAddress: streetAddress })); }; GoogleMapsGeocoded.prototype.getStreetAddress = function () { return this.streetAddress; }; GoogleMapsGeocoded.prototype.withIntersection = function (intersection) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { intersection: intersection })); }; GoogleMapsGeocoded.prototype.getIntersection = function () { return this.intersection; }; GoogleMapsGeocoded.prototype.withPolitical = function (political) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { political: political })); }; GoogleMapsGeocoded.prototype.getPolitical = function () { return this.political; }; GoogleMapsGeocoded.prototype.withColloquialArea = function (colloquialArea) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { colloquialArea: colloquialArea })); }; GoogleMapsGeocoded.prototype.getColloquialArea = function () { return this.colloquialArea; }; GoogleMapsGeocoded.prototype.withWard = function (ward) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { ward: ward })); }; GoogleMapsGeocoded.prototype.getWard = function () { return this.ward; }; GoogleMapsGeocoded.prototype.withNeighborhood = function (neighborhood) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { neighborhood: neighborhood })); }; GoogleMapsGeocoded.prototype.getNeighborhood = function () { return this.neighborhood; }; GoogleMapsGeocoded.prototype.withPremise = function (premise) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { premise: premise })); }; GoogleMapsGeocoded.prototype.getPremise = function () { return this.premise; }; GoogleMapsGeocoded.prototype.withSubpremise = function (subpremise) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { subpremise: subpremise })); }; GoogleMapsGeocoded.prototype.getSubpremise = function () { return this.subpremise; }; GoogleMapsGeocoded.prototype.withNaturalFeature = function (naturalFeature) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { naturalFeature: naturalFeature })); }; GoogleMapsGeocoded.prototype.getNaturalFeature = function () { return this.naturalFeature; }; GoogleMapsGeocoded.prototype.withAirport = function (airport) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { airport: airport })); }; GoogleMapsGeocoded.prototype.getAirport = function () { return this.airport; }; GoogleMapsGeocoded.prototype.withPark = function (park) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { park: park })); }; GoogleMapsGeocoded.prototype.getPark = function () { return this.park; }; GoogleMapsGeocoded.prototype.withPointOfInterest = function (pointOfInterest) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { pointOfInterest: pointOfInterest })); }; GoogleMapsGeocoded.prototype.getPointOfInterest = function () { return this.pointOfInterest; }; GoogleMapsGeocoded.prototype.withEstablishment = function (establishment) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { establishment: establishment })); }; GoogleMapsGeocoded.prototype.getEstablishment = function () { return this.establishment; }; GoogleMapsGeocoded.prototype.withPostalCodeSuffix = function (postalCodeSuffix) { return new GoogleMapsGeocoded(__assign(__assign({}, this.toObject()), { postalCodeSuffix: postalCodeSuffix })); }; GoogleMapsGeocoded.prototype.getPostalCodeSuffix = function () { return this.postalCodeSuffix; }; GoogleMapsGeocoded.prototype.addSubLocalityLevel = function (subLocalityLevel) { this.subLocalityLevels.push(subLocalityLevel); }; GoogleMapsGeocoded.prototype.getSubLocalityLevels = function () { return this.subLocalityLevels; }; return GoogleMapsGeocoded; }(Geocoded)); export default GoogleMapsGeocoded; //# sourceMappingURL=GoogleMapsGeocoded.js.map