Angular-google-maps: Google now requires ApiKey for all new URLs, please update readme.md with...

Created on 17 Aug 2016  路  6Comments  路  Source: SebastianM/angular-google-maps

Issue description
Google now requires ApiKey for all new URLs, please update readme.md with code below

var googleKey = function () {
    var config = new LazyMapsAPILoaderConfig();
    config.apiKey = 'YOUR_KEY';
    return config;
}

@NgModule({
    imports: [BrowserModule],
    providers: [ANGULAR2_GOOGLE_MAPS_PROVIDERS,
    {provide: LazyMapsAPILoaderConfig, useFactory: () => googleKey()}],
    bootstrap: [Main],
})
export class App {
}

Steps to reproduce and a minimal demo of the problem
use a new URL that was not grandfathered in (google never seen it) and map will not work

Current behavior
no data

Expected/desired behavior
if key provided all works

important docs

Most helpful comment

Ya, I will update this example:

@NgModule({
  imports: [BrowserModule, AgmCoreModule.forRoot()],
  providers: [
    provideLazyMapsAPILoaderConfig({apiKey: 'key'})
  ],
  declarations: [MyMapsProjectAppComponent],
  bootstrap: [MyMapsProjectAppComponent]
})
export class AppModule {
}

All 6 comments

Ya, I will update this example:

@NgModule({
  imports: [BrowserModule, AgmCoreModule.forRoot()],
  providers: [
    provideLazyMapsAPILoaderConfig({apiKey: 'key'})
  ],
  declarations: [MyMapsProjectAppComponent],
  bootstrap: [MyMapsProjectAppComponent]
})
export class AppModule {
}

Hello, there is a another configuration to do in the project besides the code description above? I'm asking cause I can't run my app, the error in console is referent a MissingKeyMapError from Google Maps API. Thanks!

@dlpitta hey! no, that's it. Can you share your code? Otherwise I'm not able to help you

@SebastianM, in this middle time, I solved the problem. I'm not sure what causes the problem but I just unified the .html e .css files inside the code of responsible component for Google Maps API implementation, and it works! Thanks for your time!

The new Getting started guide covers this now: https://angular-maps.com/docs/getting-started.html

The new Getting started guide covers this now: https://angular-maps.com/docs/getting-started.html
Hi
Link is missed
In other https://angular-maps.com/guides/getting-started/
above sample not exists

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ostapch picture ostapch  路  4Comments

Subhojit1992 picture Subhojit1992  路  3Comments

ChrisDevinePimss picture ChrisDevinePimss  路  3Comments

gnujeremie picture gnujeremie  路  3Comments

stot3 picture stot3  路  3Comments