Online Maps  v3
OnlineMapsGoogleGeocoding Class Reference

This class is used to search for a location by address.
https://developers.google.com/maps/documentation/geocoding/intro More...

Inheritance diagram for OnlineMapsGoogleGeocoding:
OnlineMapsTextWebService OnlineMapsWebServiceAPI

Classes

class  GeocodingParams
 Request parameters for Geocoding More...
 
class  RequestParams
 The base class containing the request parameters. More...
 
class  ReverseGeocodingParams
 Request parameters for Reverse Geocoding More...
 

Public Member Functions

 OnlineMapsGoogleGeocoding (string address, string key=null)
 Creates a new request for a location search by title (geocoding). More...
 
 OnlineMapsGoogleGeocoding (Vector2 coords, string key=null)
 Creates a new request for a location search by coordinates (reverse geocoding). More...
 
 OnlineMapsGoogleGeocoding (double longitude, double latitude, string key=null)
 Creates a new request for a location search by coordinates (reverse geocoding). More...
 
- 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...
 

Static Public Member Functions

static OnlineMapsGoogleGeocoding Find (RequestParams p)
 Creates a new request for a location search using object with parameters. More...
 
static Vector2 GetCoordinatesFromResult (string response)
 Gets the coordinates of the first results from OnlineMapsFindLocation result. More...
 
static OnlineMapsGoogleGeocodingResult[] GetResults (string response)
 Converts response into an array of results. More...
 
static void MovePositionToResult (string response)
 Centers the map on the result of the search location. More...
 

Protected Member Functions

 OnlineMapsGoogleGeocoding (string address=null, string latlng=null, string lang=null)
 Constructor. More...
 
- Protected Member Functions inherited from OnlineMapsTextWebService
void OnRequestComplete (OnlineMapsWWW www)
 Checks whether the response from webservice. More...
 

Additional Inherited Members

- 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 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

This class is used to search for a location by address.
https://developers.google.com/maps/documentation/geocoding/intro

Constructor & Destructor Documentation

◆ OnlineMapsGoogleGeocoding() [1/4]

OnlineMapsGoogleGeocoding.OnlineMapsGoogleGeocoding ( string  address,
string  key = null 
)

Creates a new request for a location search by title (geocoding).

Parameters
addressLocation title
keyGoogle API key

◆ OnlineMapsGoogleGeocoding() [2/4]

OnlineMapsGoogleGeocoding.OnlineMapsGoogleGeocoding ( Vector2  coords,
string  key = null 
)

Creates a new request for a location search by coordinates (reverse geocoding).

Parameters
coordsLocation coordinates (X - longitude, Y - latitude)
keyGoogle API key

◆ OnlineMapsGoogleGeocoding() [3/4]

OnlineMapsGoogleGeocoding.OnlineMapsGoogleGeocoding ( double  longitude,
double  latitude,
string  key = null 
)

Creates a new request for a location search by coordinates (reverse geocoding).

Parameters
longitudeLongitude
latitudeLatitude
keyGoogle API key

◆ OnlineMapsGoogleGeocoding() [4/4]

OnlineMapsGoogleGeocoding.OnlineMapsGoogleGeocoding ( string  address = null,
string  latlng = null,
string  lang = null 
)
protected

Constructor.

Parameters
addressLocation title
latlngLocation coordinates (latitude,longitude). Example: 40.714224,-73.961452.
langLanguage of result

Member Function Documentation

◆ Find()

static OnlineMapsGoogleGeocoding OnlineMapsGoogleGeocoding.Find ( RequestParams  p)
static

Creates a new request for a location search using object with parameters.

Parameters
pParameters of request
Returns
Instance of the search query.

◆ GetCoordinatesFromResult()

static Vector2 OnlineMapsGoogleGeocoding.GetCoordinatesFromResult ( string  response)
static

Gets the coordinates of the first results from OnlineMapsFindLocation result.

Parameters
responseXML string. The result of the search location.
Returns
Coordinates - if successful, Vector2.zero - if failed.

◆ GetResults()

static OnlineMapsGoogleGeocodingResult [] OnlineMapsGoogleGeocoding.GetResults ( string  response)
static

Converts response into an array of results.

Parameters
responseResponse of Google API.
Returns
Array of result.

◆ MovePositionToResult()

static void OnlineMapsGoogleGeocoding.MovePositionToResult ( string  response)
static

Centers the map on the result of the search location.

Parameters
responseXML string. The result of the search location.