Skip to content

Latest commit

 

History

History
71 lines (37 loc) · 2.04 KB

SearchBox.md

File metadata and controls

71 lines (37 loc) · 2.04 KB

See html formatted version

SearchBox class

google.maps.places.SearchBox class

A widget that provides query predictions based on a user's text input. It attaches to an input element of type text, and listens for text entry in that field. The list of predictions is presented as a drop-down list, and is updated as text is entered.

This class extends MVCObject.

Library

places

Constructor

undefined

SearchBox(inputField[, opts])

Parameters: 

Creates a new instance of SearchBox that attaches to the specified input text field with the given options.

Methods

undefined

getBounds()

Parameters:  None

Return Value:  LatLngBounds

Returns the bounds to which query predictions are biased.

undefined

getPlaces()

Parameters:  None

Return Value:  Array<PlaceResult>

Returns the query selected by the user, or null if no places have been found yet, to be used with places_changed event.

undefined

setBounds(bounds)

Parameters: 

Return Value:  None

Sets the region to use for biasing query predictions. Results will only be biased towards this area and not be completely restricted to it.

Events

undefined

function()

Arguments:  None

This event is fired when the user selects a query, getPlaces should be used to get new places.