angular2-google-maps
Version:
Angular 2 components for Google Maps
45 lines (41 loc) • 1.94 kB
text/typescript
import {ModuleWithProviders, NgModule} from '@angular/core';
import {SebmGoogleMapKmlLayer} from './directives/google-map-kml-layer';
import {SebmGoogleMap} from './directives/google-map';
import {SebmGoogleMapCircle} from './directives/google-map-circle';
import {SebmGoogleMapInfoWindow} from './directives/google-map-info-window';
import {SebmGoogleMapMarker} from './directives/google-map-marker';
import {SebmGoogleMapPolygon} from './directives/google-map-polygon';
import {SebmGoogleMapPolyline} from './directives/google-map-polyline';
import {SebmGoogleMapPolylinePoint} from './directives/google-map-polyline-point';
import {LazyMapsAPILoader} from './services/maps-api-loader/lazy-maps-api-loader';
import {LAZY_MAPS_API_CONFIG, LazyMapsAPILoaderConfigLiteral} from './services/maps-api-loader/lazy-maps-api-loader';
import {MapsAPILoader} from './services/maps-api-loader/maps-api-loader';
import {BROWSER_GLOBALS_PROVIDERS} from './utils/browser-globals';
/**
* @internal
*/
export function coreDirectives() {
return [
SebmGoogleMap, SebmGoogleMapMarker, SebmGoogleMapInfoWindow, SebmGoogleMapCircle,
SebmGoogleMapPolygon, SebmGoogleMapPolyline, SebmGoogleMapPolylinePoint, SebmGoogleMapKmlLayer
];
};
/**
* The angular2-google-maps core module. Contains all Directives/Services/Pipes
* of the core module. Please use `AgmCoreModule.forRoot()` in your app module.
*/
@NgModule({declarations: coreDirectives(), exports: coreDirectives()})
export class AgmCoreModule {
/**
* Please use this method when you register the module at the root level.
*/
static forRoot(lazyMapsAPILoaderConfig?: LazyMapsAPILoaderConfigLiteral): ModuleWithProviders {
return {
ngModule: AgmCoreModule,
providers: [
...BROWSER_GLOBALS_PROVIDERS, {provide: MapsAPILoader, useClass: LazyMapsAPILoader},
{provide: LAZY_MAPS_API_CONFIG, useValue: lazyMapsAPILoaderConfig}
],
};
}
}