java.lang.Object | ||
↳ | com.google.android.gms.common.api.GoogleApi<com.google.android.gms.location.places.PlacesOptions> | |
↳ | com.google.android.gms.location.places.GeoDataClient |
Main entry point for the Google Places Geo Data API.
The Geo Data API provides access to Google's database of local place and business information. A place, generally, is defined as a particular physical space that has a name. The Geo Data API provides access to getting information about places by place ID, autocompleting a user's search query by name or address, and adding new places to Google's Places database. Most API methods involve a network round-trip to a Google server.
Some methods are subject to a quota limit, as mentioned in the description of the methods concerned. See the developer's guide for more information on quota and usage limits.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GeoDataClient.BoundsMode | Bounds restriction to be applied to Autocomplete predictions. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
The addPlace() method is deprecated as of June 30, 2017. This
feature will be turned down on June 30, 2018, and will no longer be available after that
date.
| |||||||||||
Returns autocomplete predictions for a query based on the names and addresses of places.
| |||||||||||
Returns autocomplete predictions for a query based on the names and addresses of places.
| |||||||||||
Retrieves the image data for this photo at its maximum size.
| |||||||||||
Returns the metadata for up to 10 photos associated with a place.
| |||||||||||
Retrieves the image data for this photo, scaled to fit the given dimensions.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
This method is deprecated.
The addPlace() method is deprecated as of June 30, 2017. This
feature will be turned down on June 30, 2018, and will no longer be available after that
date.
Adds a place to Google's Places database.
By adding a place, you can supplement the data in the Places database with data from your application. Added places are visible to your app immediately and are added to a moderation queue for possible inclusion in Google's Places database. For more information, see the developer's guide.
This method performs a network lookup.
Be sure to call release()
when finished with the result.
Parameters | |
---|---|
addPlaceRequest |
AddPlaceRequest : A request specifying the details of the place to be added. |
Returns | |
---|---|
Task<PlaceBufferResponse> |
A buffer containing a Place object representing the added place. |
Returns autocomplete predictions for a query based on the names and addresses of places. For more information, see the developer's guide.
This method performs a network lookup.
Access to this method is subject to quota restrictions. See Usage Limits for more details.
Be sure to call release()
when finished with
the result.
Parameters | |
---|---|
query |
String : The query string for which the autocomplete predictions are to be fetched. If null
or empty, no predictions will be returned. |
bounds |
LatLngBounds : A geographic bounds. If present, returned predictions will be biased towards
places in this area. |
filter |
AutocompleteFilter : A filter to use for restricting the returned predictions. If null, a filter with
no constraints will be used. |
Returns | |
---|---|
Task<AutocompletePredictionBufferResponse> |
A buffer containing a list of predictions for the query. |
Returns autocomplete predictions for a query based on the names and addresses of places. For more information, see the developer's guide.
This method performs a network lookup.
Access to this method is subject to quota restrictions. See Usage Limits for more details.
Be sure to call release()
when finished with
the result.
Parameters | |
---|---|
query |
String : The query string for which the autocomplete predictions are to be fetched. If null
or empty, no predictions will be returned. |
bounds |
LatLngBounds : A geographic bounds. If present, returned predictions will be influenced towards
places in this area as per the boundsMode parameter. |
boundsMode |
int : How to treat the bounds parameter. When set to STRICT predictions are
contained by the supplied bounds. If set to BIAS predictions are biased towards the
supplied bounds. If bounds is null then this parameter has no effect. |
filter |
AutocompleteFilter : A filter to use for restricting the returned predictions. If null, a filter with
no constraints will be used. |
Returns | |
---|---|
Task<AutocompletePredictionBufferResponse> |
A buffer containing a list of predictions for the query. |
Retrieves the image data for this photo at its maximum size.
The photos service may cache the image data. If the requested photo does not exist in the cache then a network lookup will be performed.
Access to this method is subject to quota restrictions. See Usage Limits for more details.
Parameters | |
---|---|
photoMetadata |
PlacePhotoMetadata : The PlacePhotoMetadata for which to load the photo bitmap. |
Returns | |
---|---|
Task<PlacePhotoResponse> |
A Bitmap of the image data.
|
Returns Place
objects for each of the given place IDs.
This method might return fewer places than requested if some of the given ids could not be resolved.
The maximum number of place IDs that will be returned is 20. If more than 20 places are requested, some of them may not be returned.
The Geo Data API may cache recently accessed places. If any of the requested places are not cached then this method will perform a network lookup.
Access to this method is subject to quota restrictions. See Usage Limits for more details.
Be sure to call release()
when finished with the result.
Parameters | |
---|---|
placeIds |
String : The place IDs to look up. At least one ID should be provided. |
Returns | |
---|---|
Task<PlaceBufferResponse> |
A buffer containing the requested places. |
Returns the metadata for up to 10 photos associated with a place.
Photos are sourced from a variety of locations, including business owners and photos
contributed by Google+ users. In most cases, these photos can be used without attribution, or
will have the required attribution included as a part of the image. However, you must call
getAttributions()
to retrieve any additional attributions required,
and display those attributions in your application wherever you display the image. A maximum of
10 photos is returned. For more information, see the developer's guide.
Multiple calls of this method will probably return the same photos each time. However, this is not guaranteed because the underlying data may have changed.
This method performs a network lookup.
Be sure to call release()
when finished with the result.
Parameters | |
---|---|
placeId |
String : The Place ID of the
place |
Returns | |
---|---|
Task<PlacePhotoMetadataResponse> |
a buffer containing metadata about the photos available for the requested place. |
Retrieves the image data for this photo, scaled to fit the given dimensions.
The image will be scaled to match the smaller of the given dimensions whilst maintaining the original aspect ratio. This scaling is performed server-side.
The photos service may cache the image data. If the requested photo does not exist in the cache then a network lookup will be performed.
Access to this method is subject to quota restrictions. See Usage Limits for more details.
Parameters | |
---|---|
photoMetadata |
PlacePhotoMetadata : The PlacePhotoMetadata for which to load the photo bitmap. |
width |
int : The desired maximum width in pixels. |
height |
int : The desired maximum height in pixels. |
Returns | |
---|---|
Task<PlacePhotoResponse> |
A Bitmap of the image data. |
Throws | |
---|---|
IllegalArgumentException |
If either of the given width or height values are less than or equal to 0. |