0

I just installed agm/core and related stuff to use maps using these commands

npm install @agm/core --save
npm install @types/googlemaps --save-dev

And then i imported AgmCoreModule like this in my module.ts

import { AgmCoreModule } from '@agm/core';

imports : [
    AgmCoreModule.forRoot({
      apiKey: 'my api key',
      libraries: ['places']
    })
]

And inside of my component i just used map like this

<agm-map [latitude]="latitude" [longitude]="longitude" [zoom]="zoom">
  <agm-marker [latitude]="latitude" [longitude]="longitude"></agm-marker>
</agm-map>

But i am getting this error

Google Maps JavaScript API error: InvalidKeyMapError

I don't know why this error is occurring. Can any one let me know?

Fahad Subzwari
  • 2,109
  • 3
  • 24
  • 52
  • This error usually states, that the apiKey is not correct.. Double check that. I also heard, that it could occur if the js gets included twice. – jeger Dec 09 '20 at 12:44
  • No i double checked this issue. I recently generated a new apiKey and i just installed `agm/core` library in my project and included in my just one module also with api key. – Fahad Subzwari Dec 10 '20 at 07:14

0 Answers0