BUG - InvalidValueError: setTypes: not an Array with country="fr"
Hello when i use to
<input matInput matGoogleMapsAutocomplete country="fr" placeholder="Vous avez le choix : Code Postal | Ville | Département | Région" (onAutocompleteSelected)="onAutocompleteSelected($event)" (onLocationSelected)="onLocationSelected($event)">
I have a log error navigator : InvalidValueError: setTypes: not an Array
when I take off country="fr" the error disappears.
Thanks for your help
OS and Version?
macOS(Sierra )
Versions
@angular-devkit/architect 0.800.6 @angular-devkit/build-angular 0.800.6 @angular-devkit/build-optimizer 0.800.6 @angular-devkit/build-webpack 0.800.6 @angular-devkit/core 8.0.6 @angular-devkit/schematics 8.0.6 @angular/cdk 8.1.2 @angular/cli 8.0.6 @angular/http 7.2.15 @angular/material 8.1.2 @ngtools/webpack 8.0.6 @schematics/angular 8.0.6 @schematics/update 0.800.6 rxjs 6.4.0 typescript 3.4.5 webpack 4.30.0
I have the same issue but with country="co" InvalidValueError: setTypes: not an Array
It should have square brackets around country as highlighted in the example [country] = "fr"
The larger issue is that it still does not restrict the suggestions to the specified country. Thats being tracked by Issue #172
here is an example
<input
(onAutocompleteSelected)="syncAutoComplete($event, this.initialTargetFormGroup, 'property')"
[placeholder]="'msa.target.property.placeholder' | translate"
country="de"
formControlName="property"
matGoogleMapsAutocomplete
matInput
required
/>
and it works fine 👍
Helo, I have the following code:
<mat-google-maps-autocomplete #autocompleteStart (onAutocompleteSelected)="onAutocompleteSelectedStart($event)" (onLocationSelected)="onLocationSelectedStart($event)" [appearance]="appearance.OUTLINE" addressLabelText="Inicio" class="autocomplete" country="co"> </mat-google-maps-autocomplete>
I have a log error navigator:
InvalidValueError: setTypes: not an Array
when I take off country="co" the error disappears
OS and Version? macOS( Mojave )
Hello,
Thanks for your answer.
i used [country]="['fr']" to make it work.
@vswom [country]="['fr']" works and does restrict the filter by country but the InvalidValueError: setTypes: not an Array error still appears.
The larger issue is that it still does not restrict the suggestions to the specified country. Thats being tracked by Issue #172
By adding [types]="['(regions)']" , it works
ex: <mat-google-maps-autocomplete [types]="['(regions)']" country="ch"></mat-google-maps-autocomplete>
By adding
[types]="['(regions)']", it works
The solution posted by @Svkiyo works like a charm
It works but results are in english language whereas previously results were in french language