Merge pull request #4090 from adrienkohlbecker/master

Add google places AutocompleteService
This commit is contained in:
Masahiro Wakame
2015-04-12 10:57:24 +09:00
+49
View File
@@ -1345,6 +1345,55 @@ declare module google.maps {
}
export module places {
export class AutocompleteService extends MVCObject {
constructor();
getPlacePredictions(request: AutocompletionRequest, callback: (result: AutocompletePrediction[], status: PlacesServiceStatus) => void): void;
getQueryPredictions(request: QueryAutocompletionRequest, callback: (result: QueryAutocompletePrediction[], status: PlacesServiceStatus) => void): void;
}
export interface AutocompletionRequest {
input: string;
bounds?: LatLngBounds;
componentRestrictions?: ComponentRestrictions;
location?: LatLng;
offset?: number;
radius?: number;
types?: string[];
}
export interface QueryAutocompletionRequest {
input: string;
bounds?: LatLngBounds;
location?: LatLng;
offset?: number;
radius?: number;
}
export interface AutocompletePrediction {
description: string;
matched_substrings: PredictionSubstring[];
place_id: string;
terms: PredictionTerm[];
types: string[]
}
export interface PredictionTerm {
offset: number;
value: string;
}
export interface PredictionSubstring {
length: number;
offset: number;
}
export interface QueryAutocompletePrediction {
description: string;
matched_substrings: PredictionSubstring[];
place_id: string;
terms: PredictionTerm[];
}
export class Autocomplete extends MVCObject {
constructor (inputField: HTMLInputElement, opts?: AutocompleteOptions);