Can someone tell me how to initialize React Google Maps\'s StandaloneSearchBox component with types: [\'geocode\'] (like in the original google.maps.places.Autocomplete, so
StandaloneSearchBox is a wrapper around google.maps.places.SearchBox.
So Google documentation for SearchBox says that:
The SearchBox constructor takes two arguments:
- An HTML input element of type text. This is the input field that the SearchBox service will monitor and attach its results to.
- An options argument, which can contain the bounds property: bounds is a google.maps.LatLngBounds object specifying the area in which to search for places. The results are biased towards, but not restricted to, places contained within these bounds.
Source: https://developers.google.com/maps/documentation/javascript/places-autocomplete#places_searchbox
So you can call this component like this:
Where defaultBounds
is a LatLngBounds class which is represents a rectangle in geographical coordinates.