I am using @react-google-maps/api package for Autocomplete result. But I am trying to get result only from Mallorca island, Spain.
const bounds = {
north: 39.980392,
south: 39.254704,
east: 3.463581,
west: 2.263324,
}
const restrictions = {
country: 'es',
}
... ... ... ...
render() {
return (
<div className="p-8">
<LoadScript
googleMapsApiKey="My API Key"
libraries={["places"]}
>
<Autocomplete
onLoad={this.onFromLoad}
onPlaceChanged={this.onFromPlaceChanged}
bounds={bounds}
restrictions={restrictions}
>
<TextField
className="mb-6 w-full"
label="From"
onChange={this.handleChange}
type="text"
name="from"
value={this.state.from}
validators={["required"]}
errorMessages={[
"this field is required"
]}
/>
</Autocomplete>
</LoadScript>
</div>
)
}
The result is restricted to only country (Spain). Not restricted to specific bounds region.
Please help me.