Package com.google.maps
Class PlacesApi
- java.lang.Object
-
- com.google.maps.PlacesApi
-
public class PlacesApi extends java.lang.ObjectPerforms a text search for places. The Google Places API enables you to get data from the same database used by Google Maps and Google+ Local. Places features more than 100 million businesses and points of interest that are updated frequently through owner-verified listings and user-moderated contributions.See also: Places API Web Service documentation.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FindPlaceFromTextRequestfindPlaceFromText(GeoApiContext context, java.lang.String input, FindPlaceFromTextRequest.InputType inputType)Find places using either search text, or a phone number.static NearbySearchRequestnearbySearchNextPage(GeoApiContext context, java.lang.String nextPageToken)Retrieves the next page of Nearby Search results.static NearbySearchRequestnearbySearchQuery(GeoApiContext context, LatLng location)Performs a search for nearby Places.static PhotoRequestphoto(GeoApiContext context, java.lang.String photoReference)Requests a Photo from a PhotoReference.static PlaceAutocompleteRequestplaceAutocomplete(GeoApiContext context, java.lang.String input, PlaceAutocompleteRequest.SessionToken sessionToken)Creates a new Places Autocomplete request for a given input.static PlaceDetailsRequestplaceDetails(GeoApiContext context, java.lang.String placeId)Requests the details of a Place.static PlaceDetailsRequestplaceDetails(GeoApiContext context, java.lang.String placeId, PlaceAutocompleteRequest.SessionToken sessionToken)Requests the details of a Place.static QueryAutocompleteRequestqueryAutocomplete(GeoApiContext context, java.lang.String input)Allows you to add on-the-fly geographic query predictions to your application.static TextSearchRequesttextSearchNextPage(GeoApiContext context, java.lang.String nextPageToken)Retrieves the next page of Text Search results.static TextSearchRequesttextSearchQuery(GeoApiContext context, PlaceType type)Performs a search for Places using a PlaceType parameter.static TextSearchRequesttextSearchQuery(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".
-
-
-
Method Detail
-
nearbySearchQuery
public static NearbySearchRequest nearbySearchQuery(GeoApiContext context, LatLng location)
Performs a search for nearby Places.- Parameters:
context- The context on which to make Geo API requests.location- The latitude/longitude around which to retrieve place information.- Returns:
- Returns a NearbySearchRequest that can be configured and executed.
-
nearbySearchNextPage
public static NearbySearchRequest nearbySearchNextPage(GeoApiContext context, java.lang.String nextPageToken)
Retrieves the next page of Nearby Search results. The nextPageToken, returned in a PlacesSearchResponse when there are more pages of results, encodes all of the original Nearby Search Request parameters, which are thus not required on this call.- Parameters:
context- The context on which to make Geo API requests.nextPageToken- The nextPageToken returned as part of a PlacesSearchResponse.- Returns:
- Returns a NearbySearchRequest that can be executed.
-
textSearchQuery
public 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".- Parameters:
context- The context on which to make Geo API requests.query- The text string on which to search, for example: "restaurant".- Returns:
- Returns a TextSearchRequest that can be configured and executed.
-
textSearchQuery
public static TextSearchRequest textSearchQuery(GeoApiContext context, PlaceType type)
Performs a search for Places using a PlaceType parameter.- Parameters:
context- The context on which to make Geo API requests.type- Restricts the results to places matching the specified PlaceType.- Returns:
- Returns a TextSearchRequest that can be configured and executed.
-
textSearchNextPage
public static TextSearchRequest textSearchNextPage(GeoApiContext context, java.lang.String nextPageToken)
Retrieves the next page of Text Search results. The nextPageToken, returned in a PlacesSearchResponse when there are more pages of results, encodes all of the original Text Search Request parameters, which are thus not required on this call.- Parameters:
context- The context on which to make Geo API requests.nextPageToken- The nextPageToken returned as part of a PlacesSearchResponse.- Returns:
- Returns a TextSearchRequest that can be executed.
-
placeDetails
public static PlaceDetailsRequest placeDetails(GeoApiContext context, java.lang.String placeId, PlaceAutocompleteRequest.SessionToken sessionToken)
Requests the details of a Place.We are only enabling looking up Places by placeId as the older Place identifier, reference, is deprecated. Please see the deprecation warning.
- Parameters:
context- The context on which to make Geo API requests.placeId- The PlaceID to request details on.sessionToken- The Session Token for this request.- Returns:
- Returns a PlaceDetailsRequest that you can configure and execute.
-
placeDetails
public static PlaceDetailsRequest placeDetails(GeoApiContext context, java.lang.String placeId)
Requests the details of a Place.We are only enabling looking up Places by placeId as the older Place identifier, reference, is deprecated. Please see the deprecation warning.
- Parameters:
context- The context on which to make Geo API requests.placeId- The PlaceID to request details on.- Returns:
- Returns a PlaceDetailsRequest that you can configure and execute.
-
photo
public static PhotoRequest photo(GeoApiContext context, java.lang.String photoReference)
Requests a Photo from a 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.
- Parameters:
context- The context on which to make Geo API requests.photoReference- The reference to the photo to retrieve.- Returns:
- Returns a PhotoRequest that you can execute.
-
placeAutocomplete
public static PlaceAutocompleteRequest placeAutocomplete(GeoApiContext context, java.lang.String input, PlaceAutocompleteRequest.SessionToken sessionToken)
Creates a new Places Autocomplete request for a given input. The Place Autocomplete service can match on full words as well as substrings. Applications can therefore send queries as the user types, to provide on-the-fly place predictions.- Parameters:
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.- Returns:
- Returns a PlaceAutocompleteRequest that you can configure and execute.
-
queryAutocomplete
public static QueryAutocompleteRequest queryAutocomplete(GeoApiContext context, java.lang.String input)
Allows you to add on-the-fly geographic query predictions to your application.- Parameters:
context- The context on which to make Geo API requests.input- input is the text string on which to search.- Returns:
- Returns a QueryAutocompleteRequest that you can configure and execute.
-
findPlaceFromText
public static FindPlaceFromTextRequest findPlaceFromText(GeoApiContext context, java.lang.String input, FindPlaceFromTextRequest.InputType inputType)
Find places using either search text, or a phone number.- Parameters:
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.- Returns:
- Returns a FindPlaceFromTextRequest that you can configure and execute.
-
-