Google map is not working in Angular and giving an error of InvalidKeyMapError

Discussão em 'Angular' iniciado por Fahad Subzwari, Outubro 6, 2024.

  1. 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?

    Continue reading...

Compartilhe esta Página