Online Maps v3
Loading...
Searching...
No Matches
OnlineMapsGooglePlaces Class Reference

The Google Places API allows you to query for place information on a variety of categories, such as: establishments, prominent points of interest, geographic locations, and more.
You can search for places either by proximity or a text string.
A Place Search returns a list of places along with summary information about each place.
https://developers.google.com/places/web-service/search. More...

Inheritance diagram for OnlineMapsGooglePlaces:
OnlineMapsTextWebService OnlineMapsWebServiceAPI

Classes

class  NearbyParams
 Request parameters for Nearby Search. More...
 
class  RadarParams
 Request parameters for Radar Search. More...
 
class  RequestParams
 The base class containing the request parameters. More...
 
class  TextParams
 Request parameters for Text Search. More...
 

Public Types

enum  OnlineMapsFindPlacesRankBy { prominence , distance }
 Specifies the order in which results are listed. More...
 

Static Public Member Functions

static OnlineMapsGooglePlaces FindNearby (Vector2 lnglat, int radius, string key, string keyword=null, string name=null, string types=null, int minprice=-1, int maxprice=-1, bool opennow=false, OnlineMapsFindPlacesRankBy rankBy=OnlineMapsFindPlacesRankBy.prominence)
 A Nearby Search lets you search for places within a specified area.
You can refine your search request by supplying keywords or specifying the type of place you are searching for.
 
static OnlineMapsGooglePlaces FindNearby (string key, NearbyParams p)
 A Nearby Search lets you search for places within a specified area.
You can refine your search request by supplying keywords or specifying the type of place you are searching for.
 
static OnlineMapsGooglePlaces FindText (string query, string key, Vector2 lnglat=default(Vector2), int radius=-1, string language=null, string types=null, int minprice=-1, int maxprice=-1, bool opennow=false)
 Returns information about a set of places based on a string — for example "pizza in New York" or "shoe stores near Ottawa".
The service responds with a list of places matching the text string and any location bias that has been set.
The search response will include a list of places.
 
static OnlineMapsGooglePlaces FindText (string key, TextParams p)
 Returns information about a set of places based on a string — for example "pizza in New York" or "shoe stores near Ottawa".
The service responds with a list of places matching the text string and any location bias that has been set.
The search response will include a list of places.
 
static OnlineMapsGooglePlaces FindRadar (Vector2 lnglat, int radius, string key, string keyword=null, string name=null, string types=null, int minprice=-1, int maxprice=-1, bool opennow=false)
 The Google Places API Radar Search Service allows you to search for up to 200 places at once, but with less detail than is typically returned from a Text Search or Nearby Search request.
With Radar Search, you can create applications that help users identify specific areas of interest within a geographic area.
 
static OnlineMapsGooglePlaces FindRadar (string key, RadarParams p)
 The Google Places API Radar Search Service allows you to search for up to 200 places at once, but with less detail than is typically returned from a Text Search or Nearby Search request.
With Radar Search, you can create applications that help users identify specific areas of interest within a geographic area.
 
static OnlineMapsGooglePlacesResult[] GetResults (string response)
 Converts response into an array of results.
 
static OnlineMapsGooglePlacesResult[] GetResults (string response, out string nextPageToken)
 Converts response into an array of results.
 

Additional Inherited Members

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

Detailed Description

The Google Places API allows you to query for place information on a variety of categories, such as: establishments, prominent points of interest, geographic locations, and more.
You can search for places either by proximity or a text string.
A Place Search returns a list of places along with summary information about each place.
https://developers.google.com/places/web-service/search.

Member Enumeration Documentation

◆ OnlineMapsFindPlacesRankBy

Specifies the order in which results are listed.

Enumerator
prominence 

This option sorts results based on their importance.
Ranking will favor prominent places within the specified area.
Prominence can be affected by a place's ranking in Google's index, global popularity, and other factors.

distance 

This option sorts results in ascending order by their distance from the specified location.
When distance is specified, one or more of keyword, name, or types is required.

Member Function Documentation

◆ FindNearby() [1/2]

static OnlineMapsGooglePlaces OnlineMapsGooglePlaces.FindNearby ( string key,
NearbyParams p )
static

A Nearby Search lets you search for places within a specified area.
You can refine your search request by supplying keywords or specifying the type of place you are searching for.

Parameters
keyYour application's API key.
This key identifies your application for purposes of quota management and so that places added from your application are made immediately available to your app.
Visit the Google APIs Console to create an API Project and obtain your key.
pThe object containing the request parameters.
Returns
Query instance to the Google API.

◆ FindNearby() [2/2]

static OnlineMapsGooglePlaces OnlineMapsGooglePlaces.FindNearby ( Vector2 lnglat,
int radius,
string key,
string keyword = null,
string name = null,
string types = null,
int minprice = -1,
int maxprice = -1,
bool opennow = false,
OnlineMapsFindPlacesRankBy rankBy = OnlineMapsFindPlacesRankBy::prominence )
static

A Nearby Search lets you search for places within a specified area.
You can refine your search request by supplying keywords or specifying the type of place you are searching for.

Parameters
lnglatThe longitude/latitude around which to retrieve place information.
radiusDefines the distance (in meters) within which to return place results.
The maximum allowed radius is 50 000 meters.
keyYour application's API key.
This key identifies your application for purposes of quota management and so that places added from your application are made immediately available to your app.
Visit the Google APIs Console to create an API Project and obtain your key.
keywordA term to be matched against all content that Google has indexed for this place, including but not limited to name, type, and address, as well as customer reviews and other third-party content.
nameOne or more terms to be matched against the names of places, separated with a space character.
Results will be restricted to those containing the passed name values.
Note that a place may have additional names associated with it, beyond its listed name.
The API will try to match the passed name value against all of these names.
As a result, places may be returned in the results whose listed names do not match the search term, but whose associated names do.
typesRestricts the results to places matching at least one of the specified types.
Types should be separated with a pipe symbol (type1|type2|etc).
See the list of supported types:
https://developers.google.com/places/documentation/supported_types
minpriceRestricts results to only those places within the specified range.
Valid values range between 0 (most affordable) to 4 (most expensive), inclusive.
The exact amount indicated by a specific value will vary from region to region.
maxpriceRestricts results to only those places within the specified range.
Valid values range between 0 (most affordable) to 4 (most expensive), inclusive.
The exact amount indicated by a specific value will vary from region to region.
opennowReturns only those places that are open for business at the time the query is sent.
Places that do not specify opening hours in the Google Places database will not be returned if you include this parameter in your query.
rankBySpecifies the order in which results are listed.
Returns
Query instance to the Google API.

◆ FindRadar() [1/2]

static OnlineMapsGooglePlaces OnlineMapsGooglePlaces.FindRadar ( string key,
RadarParams p )
static

The Google Places API Radar Search Service allows you to search for up to 200 places at once, but with less detail than is typically returned from a Text Search or Nearby Search request.
With Radar Search, you can create applications that help users identify specific areas of interest within a geographic area.

Parameters
keyYour application's API key.
This key identifies your application for purposes of quota management and so that places added from your application are made immediately available to your app.
Visit the Google APIs Console to create an API Project and obtain your key.
pThe object containing the request parameters.
Returns
Query instance to the Google API.

◆ FindRadar() [2/2]

static OnlineMapsGooglePlaces OnlineMapsGooglePlaces.FindRadar ( Vector2 lnglat,
int radius,
string key,
string keyword = null,
string name = null,
string types = null,
int minprice = -1,
int maxprice = -1,
bool opennow = false )
static

The Google Places API Radar Search Service allows you to search for up to 200 places at once, but with less detail than is typically returned from a Text Search or Nearby Search request.
With Radar Search, you can create applications that help users identify specific areas of interest within a geographic area.

Parameters
lnglatThe longitude/latitude around which to retrieve place information.
radiusDefines the distance (in meters) within which to return place results.
The maximum allowed radius is 50 000 meters.
keyYour application's API key.
This key identifies your application for purposes of quota management and so that places added from your application are made immediately available to your app.
Visit the Google APIs Console to create an API Project and obtain your key.
keywordA term to be matched against all content that Google has indexed for this place, including but not limited to name, type, and address, as well as customer reviews and other third-party content.
nameOne or more terms to be matched against the names of places, separated by a space character.
Results will be restricted to those containing the passed name values.
Note that a place may have additional names associated with it, beyond its listed name.
The API will try to match the passed name value against all of these names.
As a result, places may be returned in the results whose listed names do not match the search term, but whose associated names do.
typesRestricts the results to places matching at least one of the specified types.
Types should be separated with a pipe symbol (type1|type2|etc).
See the list of supported types:
https://developers.google.com/maps/documentation/places/supported_types
minpriceRestricts results to only those places within the specified price level.
Valid values are in the range from 0 (most affordable) to 4 (most expensive), inclusive.
The exact amount indicated by a specific value will vary from region to region.
maxpriceRestricts results to only those places within the specified price level.
Valid values are in the range from 0 (most affordable) to 4 (most expensive), inclusive.
The exact amount indicated by a specific value will vary from region to region.
opennowReturns only those places that are open for business at the time the query is sent.
Places that do not specify opening hours in the Google Places database will not be returned if you include this parameter in your query.
Returns
Query instance to the Google API.

◆ FindText() [1/2]

static OnlineMapsGooglePlaces OnlineMapsGooglePlaces.FindText ( string key,
TextParams p )
static

Returns information about a set of places based on a string — for example "pizza in New York" or "shoe stores near Ottawa".
The service responds with a list of places matching the text string and any location bias that has been set.
The search response will include a list of places.

Parameters
keyYour application's API key.
This key identifies your application for purposes of quota management and so that places added from your application are made immediately available to your app.
Visit the Google APIs Console to create an API Project and obtain your key.
pThe object containing the request parameters.
Returns
Query instance to the Google API.

◆ FindText() [2/2]

static OnlineMapsGooglePlaces OnlineMapsGooglePlaces.FindText ( string query,
string key,
Vector2 lnglat = default(Vector2),
int radius = -1,
string language = null,
string types = null,
int minprice = -1,
int maxprice = -1,
bool opennow = false )
static

Returns information about a set of places based on a string — for example "pizza in New York" or "shoe stores near Ottawa".
The service responds with a list of places matching the text string and any location bias that has been set.
The search response will include a list of places.

Parameters
queryThe text string on which to search, for example: "restaurant".
The Google Places service will return candidate matches based on this string and order the results based on their perceived relevance.
keyYour application's API key.
This key identifies your application for purposes of quota management and so that places added from your application are made immediately available to your app.
Visit the Google APIs Console to create an API Project and obtain your key.
lnglatThe longitude/latitude around which to retrieve place information.
radiusDefines the distance (in meters) within which to bias place results.
The maximum allowed radius is 50 000 meters.
Results inside of this region will be ranked higher than results outside of the search circle; however, prominent results from outside of the search radius may be included.
languageThe language code, indicating in which language the results should be returned, if possible.
typesRestricts the results to places matching at least one of the specified types.
Types should be separated with a pipe symbol (type1|type2|etc).
See the list of supported types:
https://developers.google.com/maps/documentation/places/supported_types
minpriceRestricts results to only those places within the specified price level.
Valid values are in the range from 0 (most affordable) to 4 (most expensive), inclusive.
The exact amount indicated by a specific value will vary from region to region.
maxpriceRestricts results to only those places within the specified price level.
Valid values are in the range from 0 (most affordable) to 4 (most expensive), inclusive.
The exact amount indicated by a specific value will vary from region to region.
opennowReturns only those places that are open for business at the time the query is sent.
Places that do not specify opening hours in the Google Places database will not be returned if you include this parameter in your query.
Returns
Query instance to the Google API.

◆ GetResults() [1/2]

static OnlineMapsGooglePlacesResult[] OnlineMapsGooglePlaces.GetResults ( string response)
static

Converts response into an array of results.

Parameters
responseResponse of Google API.
Returns
Array of result.

◆ GetResults() [2/2]

static OnlineMapsGooglePlacesResult[] OnlineMapsGooglePlaces.GetResults ( string response,
out string nextPageToken )
static

Converts response into an array of results.

Parameters
responseResponse of Google API.
nextPageTokenContains a token that can be used to return up to 20 additional results.
A next_page_token will not be returned if there are no additional results to display.
The maximum number of results that can be returned is 60.
There is a short delay between when a next_page_token is issued, and when it will become valid.
Returns
Array of result.