google.maps.places.PlacesService class
Contains methods related to searching for places and retrieving details about a place.
places
Constructor
PlacesService(attrContainer)
Parameters:
- attrContainer: HTMLDivElement|Map
Creates a new instance of the PlacesService that renders attributions in the specified container.
Methods
findPlaceFromPhoneNumber(request, callback)
Parameters:
- request: FindPlaceFromPhoneNumberRequest
- callback: function(Array<PlaceResult> optional, PlacesServiceStatus)
Return Value: None
Retrieves a list of places based on a phone number. In most cases there should be just one item in the result list, however if the request is ambiguous more than one result may be returned. The PlaceResults passed to the callback are subsets of a full PlaceResult. Your app can get a more detailed PlaceResult for each place by calling PlacesService.getDetails and passing the PlaceResult.place_id for the desired place.
findPlaceFromQuery(request, callback)
Parameters:
- request: FindPlaceFromQueryRequest
- callback: function(Array<PlaceResult> optional, PlacesServiceStatus)
Return Value: None
Retrieves a list of places based on a query string. In most cases there should be just one item in the result list, however if the request is ambiguous more than one result may be returned. The PlaceResults passed to the callback are subsets of a full PlaceResult. Your app can get a more detailed PlaceResult for each place by calling PlacesService.getDetails and passing the PlaceResult.place_id for the desired place.
getDetails(request, callback)
Parameters:
- request: PlaceDetailsRequest
- callback: function(PlaceResult optional, PlacesServiceStatus)
Return Value: None
Retrieves details about the place identified by the given placeId.
nearbySearch(request, callback)
Parameters:
- request: PlaceSearchRequest
- callback: function(Array<PlaceResult> optional, PlacesServiceStatus, PlaceSearchPagination optional)
Return Value: None
Retrieves a list of places near a particular location, based on keyword or type. Location must always be specified, either by passing a LatLngBounds, or location and radius parameters. The PlaceResults passed to the callback are subsets of the full PlaceResult. Your app can get a more detailed PlaceResult for each place by sending a Place Details request passing the PlaceResult.place_id for the desired place. The PlaceSearchPagination object can be used to fetch additional pages of results (null if this is the last page of results or if there is only one page of results).
textSearch(request, callback)
Parameters:
- request: TextSearchRequest
- callback: function(Array<PlaceResult> optional, PlacesServiceStatus, PlaceSearchPagination optional)
Return Value: None
Retrieves a list of places based on a query string (for example, "pizza in New York", or "shoe stores near Ottawa"). Location parameters are optional; when the location is specified, results are only biased toward nearby results rather than restricted to places inside the area. Use textSearch when you want to search for places using an arbitrary string, and in cases where you may not want to restrict search results to a particular location. The PlaceSearchPagination object can be used to fetch additional pages of results (null if this is the last page of results or if there is only one page of results).