简体   繁体   中英

Angular2 Google Maps API warning: NoApiKeys

I am trying Google maps api with Angular2 (Angular 2 Directives for Google Maps https://angular-maps.com/ ).

I managed to get my sample working without any error. but I do see one warning in browse's console -

"Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys"

What I need to do go away this warning?

Use below code-

import {provideLazyMapsAPILoaderConfig, GOOGLE_MAPS_PROVIDERS} from 'angular2-google-maps/core';

bootstrap(AppComponent, [
  GOOGLE_MAPS_PROVIDERS,
  provideLazyMapsAPILoaderConfig({ apiKey: 'yourKey', clientId: 'yourClientId' })
])

See if this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM