Closed juanmrad closed 5 months ago
Experienced the same problem. This is caused by the Google Maps Api having not initialized the places API.
new google.maps.places.Autocomplete(...)
Where places is undefined. This in my experience can be caused by:
The second one was my case. I thought since we're using the maps js library, that this would be enough to enable. I thought the places api is more for the backend. It is not.
Same issue happening here.
Any updates here ? @juanmrad
I have this in the module of my component
@NgModule({
declarations: [...],
imports: [
...
AgmCoreModule.forRoot({
apiKey: 'AIzaSyA0Zyn9Ikl-EyWxXnJ5W7QRqjsEFN8Fa6s',
libraries: ['places']
}),
MatGoogleMapsAutocompleteModule,
And I have activated the Places API in Google, what else could go wrong ?
EDIT : versions after a fresh install
Angular CLI: 10.1.2
"@agm/core": "^3.0.0-beta.0",
"@types/googlemaps": "^3.43.3",
"@angular-material-extensions/google-maps-autocomplete": "^6.2.2",
I have this in the module of my component
@NgModule({ declarations: [...], imports: [ ... AgmCoreModule.forRoot({ apiKey: 'AIzaSyA0Zyn9Ikl-EyWxXnJ5W7QRqjsEFN8Fa6s', libraries: ['places'] }), MatGoogleMapsAutocompleteModule,
And I have activated the Places API in Google, what else could go wrong ?
EDIT : versions after a fresh install
Angular CLI: 10.1.2 "@agm/core": "^3.0.0-beta.0", "@types/googlemaps": "^3.43.3", "@angular-material-extensions/google-maps-autocomplete": "^6.2.2",
@Startouf Can you move those imports into AppModule instead ? And tell me the result
I seem to have solved my problems, not really sure what did it but
import { GoogleMapsModule } from '@angular/google-maps'
), I added &libraries=places
in the URL of this script
Bug Report or Feature Request (mark with an
x
)OS and Version
Mac OS Catalina
Versions
Repro steps
Try to add the mat autocomplete on the project and it won't work:
On my modules I have:
The log given by the failure
Desired functionality
It should just work and autocomplete work.