angular-material-extensions / google-maps-autocomplete

Autocomplete input component and directive for google-maps built with angular and material design |
https://angular-material-extensions.github.io/google-maps-autocomplete
MIT License
169 stars 60 forks source link

Is using bounds supported? #306

Closed conlont closed 5 months ago

conlont commented 3 years ago

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

The usage docs mention strictBounds parameter without mentioning the bounds parameter. Should it not be both or none? If using bounds is supported can anyone provide an example of how to implement it? Thanks

AnthonyNahas commented 3 years ago

sorry I don't have an example for the moment ...

conlont commented 3 years ago

Thanks @AnthonyNahas, no worries but it is supported?

conlont commented 3 years ago

It can be done through the autoCompleteOptions input like below:

component.ts `boundOptions: AutocompleteOptions;

this.Bounds = new google.maps.LatLngBounds();

this.boundOptions = { 
    bounds: this.Bounds,
    strictBounds: true
} `

component.html <mat-google-maps-autocomplete ... [autoCompleteOptions]="boundOptions" ...

Thanks for the help

paslavskyi9roman commented 3 years ago

@conlont I can see that you are pointing [autoCompleteOptions] attribute to the boundsOptions. Do I need any manipulation with [autoCompleteOptions] in the component.ts file?

JarvisStriker commented 3 years ago

can't i change autoCompleteOptions dynamically? let's say I want to change the bounds based on another field. Please help!