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

Type and types parameters are ignored #311

Closed tagg7 closed 5 months ago

tagg7 commented 3 years ago

Bug Report or Feature Request (mark with an x)

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

OS and Version?

Windows 10

Versions

Angular CLI: 11.1.2 Node: 14.15.4 OS: win32 x64

Angular: 11.1.1 ... animations, cdk, common, compiler, compiler-cli, core, forms ... google-maps, material, platform-browser ... platform-browser-dynamic, router Ivy Workspace: Yes

Package Version @angular-devkit/architect 0.1101.2 @angular-devkit/build-angular 0.1101.2 @angular-devkit/core 11.1.2 @angular-devkit/schematics 11.1.2 @angular/cli 11.1.2 @angular/flex-layout 11.0.0-beta.33 @schematics/angular 11.1.2 @schematics/update 0.1101.2 rxjs 6.6.3 typescript 4.1.3

Repro steps

Tried all possible combinations to restrict results by type (eg. cities, establishment, etc.).

<mat-google-maps-autocomplete type="cities">
</mat-google-maps-autocomplete>
<mat-google-maps-autocomplete types="(cities)">
</mat-google-maps-autocomplete>

Also tried binding to the type/types property but nothing changes. I tried monitoring the requests made to the Google API and the type parameter seems to be completely ignored.

The log given by the failure

Nothing in logs

Desired functionality

Results should be filtered by type.

Mention any other details that might be useful

sergeymays commented 3 years ago

i'm used this [types]="['(cities)']" , and its works

tagg7 commented 3 years ago

i'm used this [types]="['(cities)']" , and its works

What version are you using? Because I can assure you it doesn't work with the current codebase. The options being sent to Google no longer even include the "types" parameter if you check the code.

tagg7 commented 3 years ago

That's... the same version I'm using lol. But if you check the code, the "types" parameter isn't being passed into the Google API call so it's impossible as far as I can tell.

simonking91 commented 3 years ago

Just hit this same issue. It looks like you can only use [types] if you also use country, but I need to be able to use it without this restriction.

TaylorNoelJordan-zz commented 3 years ago

Is it possible to use an array of [types]? I need cities, regions, and address but it seems that's not possible.

TaylorNoelJordan-zz commented 3 years ago

@AnthonyNahas ^

AnthonyNahas commented 3 years ago

Can someone please provide an appropriate PR for that with some tests?