I'm trying to use Google Places in my Angular app to return to the user in an autocomplete input only address result which are in a radius from a location, so from the documenentation i should use parameters as location radius and strictbounds.
To use autocomplete i'm using the following ngx library but the issue is that after setting all the parameters in the options when i'm trying to write a certain address firstly i get only the one that are in the range BUT if i anyway try to write one out of range or even another city that is out of range it will still return that values and i would prevent it.
Here are my autocomplete options
addressOptions = {
types: ['address'],
componentRestrictions: {
country: 'it'
},
location: new google.maps.LatLng( 44.7179422, 10.5465457),
radius: '1000',
strictbounds: true
};
<input
type="text"
class="form-control"
required
placeholder="es. Via D'israeli"
formControlName="indirizzo"
ngxAutocomPlace
[options]="addressOptions"
(selectedPlace)="addressChange($event)"
/>