public class PlacesApi
extends java.lang.Object
See also: Places API Web Service documentation.
Modifier and Type | Method and Description |
---|---|
static FindPlaceFromTextRequest |
findPlaceFromText(GeoApiContext context,
java.lang.String input,
FindPlaceFromTextRequest.InputType inputType)
Find places using either search text, or a phone number.
|
static NearbySearchRequest |
nearbySearchNextPage(GeoApiContext context,
java.lang.String nextPageToken)
Retrieves the next page of Nearby Search results.
|
static NearbySearchRequest |
nearbySearchQuery(GeoApiContext context,
LatLng location)
Performs a search for nearby Places.
|
static PhotoRequest |
photo(GeoApiContext context,
java.lang.String photoReference)
Requests a Photo from a PhotoReference.
|
static PlaceAutocompleteRequest |
placeAutocomplete(GeoApiContext context,
java.lang.String input,
PlaceAutocompleteRequest.SessionToken sessionToken)
Creates a new Places Autocomplete request for a given input.
|
static PlaceDetailsRequest |
placeDetails(GeoApiContext context,
java.lang.String placeId)
Requests the details of a Place.
|
static QueryAutocompleteRequest |
queryAutocomplete(GeoApiContext context,
java.lang.String input)
Allows you to add on-the-fly geographic query predictions to your application.
|
static RadarSearchRequest |
radarSearchQuery(GeoApiContext context,
LatLng location,
int radius)
Deprecated.
This functionality is deprecated and will stop working on June 30, 2018.
|
static TextSearchRequest |
textSearchNextPage(GeoApiContext context,
java.lang.String nextPageToken)
Retrieves the next page of Text Search results.
|
static TextSearchRequest |
textSearchQuery(GeoApiContext context,
java.lang.String query)
Performs a search for Places using a text query; for example, "pizza in New York" or "shoe
stores near Ottawa".
|
public static NearbySearchRequest nearbySearchQuery(GeoApiContext context, LatLng location)
context
- The context on which to make Geo API requests.location
- The latitude/longitude around which to retrieve place information.public static NearbySearchRequest nearbySearchNextPage(GeoApiContext context, java.lang.String nextPageToken)
context
- The context on which to make Geo API requests.nextPageToken
- The nextPageToken returned as part of a PlacesSearchResponse.public static TextSearchRequest textSearchQuery(GeoApiContext context, java.lang.String query)
context
- The context on which to make Geo API requests.query
- The text string on which to search, for example: "restaurant".public static TextSearchRequest textSearchNextPage(GeoApiContext context, java.lang.String nextPageToken)
context
- The context on which to make Geo API requests.nextPageToken
- The nextPageToken returned as part of a PlacesSearchResponse.public static RadarSearchRequest radarSearchQuery(GeoApiContext context, LatLng location, int radius)
context
- The context on which to make Geo API requests.location
- The location around which to retrieve place information.radius
- The distance in meters within which to return place results.public static PlaceDetailsRequest placeDetails(GeoApiContext context, java.lang.String placeId)
We are only enabling looking up Places by placeId as the older Place identifier, reference, is deprecated. Please see the deprecation warning.
context
- The context on which to make Geo API requests.placeId
- The PlaceID to request details on.public static PhotoRequest photo(GeoApiContext context, java.lang.String photoReference)
Note: If you want to use a Photo in a web browser, please retrieve the photos for a place via our JavaScript Places Library. Likewise, on Android, Places Photos can be retrieved using the Google Places API for Android.
context
- The context on which to make Geo API requests.photoReference
- The reference to the photo to retrieve.public static PlaceAutocompleteRequest placeAutocomplete(GeoApiContext context, java.lang.String input, PlaceAutocompleteRequest.SessionToken sessionToken)
context
- The context on which to make Geo API requests.input
- input is the text string on which to search.sessionToken
- Session token, to make sure requests are billed per session, instead of per
character.public static QueryAutocompleteRequest queryAutocomplete(GeoApiContext context, java.lang.String input)
context
- The context on which to make Geo API requests.input
- input is the text string on which to search.public static FindPlaceFromTextRequest findPlaceFromText(GeoApiContext context, java.lang.String input, FindPlaceFromTextRequest.InputType inputType)
context
- The context on which to make Geo API requests.input
- The input to search on.inputType
- Whether the input is search text, or a phone number.