google-maps-documentation

PlacesService class

google.maps.places.PlacesService class

Contains methods related to searching for places and retrieving details about a place.

Library

places

Constructor
PlacesService
PlacesService(attrContainer)
Parameters: 
  • attrContainerHTMLDivElement|Map
Creates a new instance of the PlacesService that renders attributions in the specified container.
Methods
findPlaceFromPhoneNumber
findPlaceFromPhoneNumber(request, callback)
Parameters: 
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
findPlaceFromQuery(request, callback)
Parameters: 
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
getDetails(request, callback)
Parameters: 
Return Value:  None
Retrieves details about the place identified by the given placeId.
nearbySearch
nearbySearch(request, callback)
Parameters: 
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
textSearch(request, callback)
Parameters: 
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).