Online Maps  v3
OnlineMapsGooglePlacesAutocomplete Class Reference

Retrieves information from Google Maps Place Autocomplete API.
Place Autocomplete service is a web service that returns place predictions.
The request specifies a textual search string and optional geographic bounds.
The service can be used to provide autocomplete functionality for text-based geographic searches, by returning places such as businesses, addresses and points of interest as a user types.
Requires Google Maps API key.
https://developers.google.com/places/documentation/autocomplete More...

Inheritance diagram for OnlineMapsGooglePlacesAutocomplete:
OnlineMapsTextWebService OnlineMapsWebServiceAPI

Static Public Member Functions

static OnlineMapsGooglePlacesAutocomplete Find (string input, string key=null, string types=null, int offset=-1, Vector2 lnglat=default(Vector2), int radius=-1, string language=null, string components=null, string sessionToken=null)
 Creates a new request to the Google Maps Place Autocomplete API. More...
 
static OnlineMapsGooglePlacesAutocompleteResult[] GetResults (string response)
 Converts response into an array of results. More...
 

Additional Inherited Members

- Public Member Functions inherited from OnlineMapsTextWebService
override void Destroy ()
 Destroys the current request to webservice. More...
 
- Public Member Functions inherited from OnlineMapsWebServiceAPI
OnlineMapsWWW GetWWW ()
 Get request instance More...
 
- Public Attributes inherited from OnlineMapsTextWebService
Action< string > OnComplete
 Event that occurs when a response is received from webservice. More...
 
new Action< OnlineMapsTextWebServiceOnFailed
 Event that occurs when an error response is received from webservice More...
 
new Action< OnlineMapsTextWebServiceOnFinish
 This event is occurs after other events, before disposing the request More...
 
new Action< OnlineMapsTextWebServiceOnSuccess
 Event that occurs when a success response is received from webservice More...
 
- Public Attributes inherited from OnlineMapsWebServiceAPI
Action< OnlineMapsWebServiceAPIOnFailed
 Event that occurs when an error response is received from webservice. More...
 
Action< OnlineMapsWebServiceAPIOnFinish
 Event that occurs after OnComplete, when the response from webservice processed. More...
 
Action< OnlineMapsWebServiceAPIOnDispose
 Event that occurs when the current request instance is disposed. More...
 
Action< OnlineMapsWebServiceAPIOnSuccess
 Event that occurs when a success response is received from webservice. More...
 
object customData
 In this variable you can put any data that you need to work with requests. More...
 
- Protected Member Functions inherited from OnlineMapsTextWebService
void OnRequestComplete (OnlineMapsWWW www)
 Checks whether the response from webservice. More...
 
- Protected Attributes inherited from OnlineMapsTextWebService
string _response
 Response string More...
 
- Properties inherited from OnlineMapsTextWebService
string response [get]
 Gets a response from webservice. More...
 
- Properties inherited from OnlineMapsWebServiceAPI
OnlineMapsQueryStatus status [get]
 Gets the current status of the request to webservice. More...
 

Detailed Description

Retrieves information from Google Maps Place Autocomplete API.
Place Autocomplete service is a web service that returns place predictions.
The request specifies a textual search string and optional geographic bounds.
The service can be used to provide autocomplete functionality for text-based geographic searches, by returning places such as businesses, addresses and points of interest as a user types.
Requires Google Maps API key.
https://developers.google.com/places/documentation/autocomplete

Member Function Documentation

◆ Find()

static OnlineMapsGooglePlacesAutocomplete OnlineMapsGooglePlacesAutocomplete.Find ( string  input,
string  key = null,
string  types = null,
int  offset = -1,
Vector2  lnglat = default(Vector2),
int  radius = -1,
string  language = null,
string  components = null,
string  sessionToken = null 
)
static

Creates a new request to the Google Maps Place Autocomplete API.

Parameters
inputThe text string on which to search.
The Place Autocomplete service will return candidate matches based on this string and order results based on their perceived relevance.
keyYour application's API key. This key identifies your application for purposes of quota management.
Visit the Google APIs Console to select an API Project and obtain your key.
typesThe types of place results to return.
offsetThe position, in the input term, of the last character that the service uses to match predictions.
For example, if the input is 'Google' and the offset is 3, the service will match on 'Goo'.
The string determined by the offset is matched against the first word in the input term only.
For example, if the input term is 'Google abc' and the offset is 3, the service will attempt to match against 'Goo abc'.
If no offset is supplied, the service will use the whole term.
The offset should generally be set to the position of the text caret.
lnglatThe point around which you wish to retrieve place information.
radiusThe distance (in meters) within which to return place results.
Note that setting a radius biases results to the indicated area, but may not fully restrict results to the specified area.
languageThe language in which to return results.
componentsA grouping of places to which you would like to restrict your results.
Currently, you can use components to filter by country.
The country must be passed as a two character, ISO 3166-1 Alpha-2 compatible country code.
For example: components=country:fr would restrict your results to places within France.
sessionTokenA random string which identifies an autocomplete session for billing purposes. If this parameter is omitted from an autocomplete request, the request is billed independently.
Returns
Query instance to the Google API.

◆ GetResults()

static OnlineMapsGooglePlacesAutocompleteResult [] OnlineMapsGooglePlacesAutocomplete.GetResults ( string  response)
static

Converts response into an array of results.

Parameters
responseResponse of Google API.
Returns
Array of result.