nativescript-google-places-autocomplete-last-version
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,3 +0,3 @@ | ||
import { Observable } from 'tns-core-modules/data/observable'; | ||
export declare class Common extends Observable { | ||
export declare class Common { | ||
key: string; | ||
private apikey; | ||
@@ -4,0 +4,0 @@ constructor(key: string); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var observable_1 = require("tns-core-modules/data/observable"); | ||
var google_places_autocomplete_static_1 = require("./google-places-autocomplete.static"); | ||
var http = require("tns-core-modules/http"); | ||
var Common = (function (_super) { | ||
__extends(Common, _super); | ||
var axios_1 = require("axios"); | ||
var Common = (function () { | ||
function Common(key) { | ||
var _this = _super.call(this) || this; | ||
_this.apikey = key; | ||
return _this; | ||
this.key = key; | ||
this.apikey = key; | ||
} | ||
@@ -17,9 +14,11 @@ Common.prototype.search = function (terms, countryISO, types) { | ||
var requestUrl = google_places_autocomplete_static_1.PLACES_API_URL + | ||
"?input=" + encodeURIComponent(terms.trim()) + | ||
(countryISO ? "&components=country:" + countryISO : '') + | ||
"&types=" + types + "&key=" + | ||
'?input=' + | ||
encodeURIComponent(terms.trim()) + | ||
(countryISO ? '&components=country:' + countryISO : '') + | ||
'&types=' + | ||
types + | ||
'&key=' + | ||
this.apikey; | ||
return http | ||
.getJSON(requestUrl) | ||
.then(function (data) { | ||
return axios_1.default.get(requestUrl).then(function (_a) { | ||
var data = _a.data; | ||
var items = []; | ||
@@ -30,3 +29,3 @@ for (var i = 0; i < data.predictions.length; i++) { | ||
placeId: data.predictions[i].place_id, | ||
data: data.predictions[i] | ||
data: data.predictions[i], | ||
}); | ||
@@ -39,7 +38,8 @@ } | ||
var requestUrl = google_places_autocomplete_static_1.PLACES_DETAILS_API_URL_places + | ||
"?placeid=" + placeId + "&key=" + | ||
'?placeid=' + | ||
placeId + | ||
'&key=' + | ||
this.apikey; | ||
return http | ||
.getJSON(requestUrl) | ||
.then(function (data) { | ||
return axios_1.default.get(requestUrl).then(function (_a) { | ||
var data = _a.data; | ||
var place = {}; | ||
@@ -60,3 +60,3 @@ place.latitude = data.result.geometry.location.lat; | ||
if (!response.result) { | ||
console.log("google-geocoder error"); | ||
console.log('google-geocoder error'); | ||
console.log(JSON.stringify(response)); | ||
@@ -67,4 +67,4 @@ } | ||
return Common; | ||
}(observable_1.Observable)); | ||
}()); | ||
exports.Common = Common; | ||
//# sourceMappingURL=google-places-autocomplete.common.js.map |
{ | ||
"name": "nativescript-google-places-autocomplete-last-version", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A NativeScript plugin that works.", | ||
@@ -5,0 +5,0 @@ "main": "google-places-autocomplete", |
@@ -1,2 +0,1 @@ | ||
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" /> | ||
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" /> | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22161
115