Michael Gauthier
2018-08-13 18:56:36 -03:00
parent 206dfeb560
commit 8bdeb034ea
2 changed files with 16 additions and 8 deletions

View File

@@ -418,7 +418,8 @@ let service = new google.maps.places.PlacesService(new HTMLDivElement());
service.getDetails({
placeId: '-a1',
fields: ['name']
fields: ['name'],
sessionToken: new google.maps.places.AutocompleteSessionToken()
}, (result, status) => {
if (status === google.maps.places.PlacesServiceStatus.NOT_FOUND) {
return;

View File

@@ -1,14 +1,15 @@
// Type definitions for Google Maps JavaScript API 3.30
// Project: https://developers.google.com/maps/
// Definitions by: Folia A/S <http://www.folia.dk>,
// Chris Wrench <https://github.com/cgwrench>,
// Kiarash Ghiaseddin <https://github.com/Silver-Connection/DefinitelyTyped>,
// Grant Hutchins <https://github.com/nertzy>,
// Denis Atyasov <https://github.com/xaolas>,
// Michael McMullin <https://github.com/mrmcnerd>,
// Martin Costello <https://github.com/martincostello>,
// Definitions by: Folia A/S <http://www.folia.dk>,
// Chris Wrench <https://github.com/cgwrench>,
// Kiarash Ghiaseddin <https://github.com/Silver-Connection/DefinitelyTyped>,
// Grant Hutchins <https://github.com/nertzy>,
// Denis Atyasov <https://github.com/xaolas>,
// Michael McMullin <https://github.com/mrmcnerd>,
// Martin Costello <https://github.com/martincostello>,
// Sven Kreiss <https://github.com/svenkreiss>
// Umar Bolatov <https://github.com/bolatovumar>
// Michael Gauthier <https://github.com/gauthierm>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/*
@@ -2542,6 +2543,10 @@ declare namespace google.maps {
getQueryPredictions(request: QueryAutocompletionRequest, callback: (result: QueryAutocompletePrediction[], status: PlacesServiceStatus) => void): void;
}
export class AutocompleteSessionToken {
constructor();
}
export interface AutocompletionRequest {
bounds?: LatLngBounds|LatLngBoundsLiteral;
componentRestrictions?: ComponentRestrictions;
@@ -2549,6 +2554,7 @@ declare namespace google.maps {
location?: LatLng;
offset?: number;
radius?: number;
sessionToken?: AutocompleteSessionToken;
types?: string[];
}
@@ -2566,6 +2572,7 @@ declare namespace google.maps {
export interface PlaceDetailsRequest {
placeId: string;
fields?: string[];
sessionToken?: AutocompleteSessionToken;
}
export interface PlaceGeometry {