Skip to content

Latest commit

 

History

History
91 lines (49 loc) · 6.16 KB

PlacesService.md

File metadata and controls

91 lines (49 loc) · 6.16 KB

See html formatted version

PlacesService class

google.maps.places.PlacesService class

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

Library

places

Constructor

undefined

PlacesService(attrContainer)

Parameters: 

  • attrContainer:  HTMLDivElement|Map

Creates a new instance of the PlacesService that renders attributions in the specified container.

Methods

undefined

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.

undefined

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.

undefined

getDetails(request, callback)

Parameters: 

Return Value:  None

Retrieves details about the place identified by the given placeId.

undefined

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).

undefined

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).