1 | import {ModuleWithProviders, NgModule} from '@angular/core';
|
2 |
|
3 | import {SebmGoogleMapKmlLayer} from './directives/google-map-kml-layer';
|
4 | import {SebmGoogleMap} from './directives/google-map';
|
5 | import {SebmGoogleMapCircle} from './directives/google-map-circle';
|
6 | import {SebmGoogleMapInfoWindow} from './directives/google-map-info-window';
|
7 | import {SebmGoogleMapMarker} from './directives/google-map-marker';
|
8 | import {SebmGoogleMapPolygon} from './directives/google-map-polygon';
|
9 | import {SebmGoogleMapPolyline} from './directives/google-map-polyline';
|
10 | import {SebmGoogleMapPolylinePoint} from './directives/google-map-polyline-point';
|
11 | import {LazyMapsAPILoader} from './services/maps-api-loader/lazy-maps-api-loader';
|
12 | import {LAZY_MAPS_API_CONFIG, LazyMapsAPILoaderConfigLiteral} from './services/maps-api-loader/lazy-maps-api-loader';
|
13 | import {MapsAPILoader} from './services/maps-api-loader/maps-api-loader';
|
14 | import {BROWSER_GLOBALS_PROVIDERS} from './utils/browser-globals';
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export function coreDirectives() {
|
20 | return [
|
21 | SebmGoogleMap, SebmGoogleMapMarker, SebmGoogleMapInfoWindow, SebmGoogleMapCircle,
|
22 | SebmGoogleMapPolygon, SebmGoogleMapPolyline, SebmGoogleMapPolylinePoint, SebmGoogleMapKmlLayer
|
23 | ];
|
24 | };
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | @NgModule({declarations: coreDirectives(), exports: coreDirectives()})
|
31 | export class AgmCoreModule {
|
32 | |
33 |
|
34 |
|
35 | static forRoot(lazyMapsAPILoaderConfig?: LazyMapsAPILoaderConfigLiteral): ModuleWithProviders {
|
36 | return {
|
37 | ngModule: AgmCoreModule,
|
38 | providers: [
|
39 | ...BROWSER_GLOBALS_PROVIDERS, {provide: MapsAPILoader, useClass: LazyMapsAPILoader},
|
40 | {provide: LAZY_MAPS_API_CONFIG, useValue: lazyMapsAPILoaderConfig}
|
41 | ],
|
42 | };
|
43 | }
|
44 | }
|