blob: 56254002eb7e4f6377b53ce3ce2098d40e5ce119 [file] [log] [blame]
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import {CommonModule} from "@angular/common";
import {NgModule} from "@angular/core";
import {TranslateModule} from "@ngx-translate/core";
import {APP_CONFIGURATION, IAppConfiguration} from "../../core/configuration";
import {ActionButtonModule} from "../layout/action-button";
import {SideMenuRegistrationService} from "../layout/side-menu/services";
import {LeafletMapComponent} from "./components";
import {LeafletCenterMarkerDirective, LeafletDirective, LeafletMarkerDirective, LeafletPopupDirective} from "./directives";
import {LEAFLET_CONFIGURATION_TOKEN, LEAFLET_RESIZE_TOKEN} from "./leaflet-configuration.token";
import {StringToLatLngZoomPipe} from "./pipes";
@NgModule({
imports: [
CommonModule,
ActionButtonModule,
TranslateModule
],
declarations: [
LeafletCenterMarkerDirective,
LeafletDirective,
LeafletMarkerDirective,
LeafletPopupDirective,
LeafletMapComponent,
StringToLatLngZoomPipe
],
exports: [
LeafletCenterMarkerDirective,
LeafletDirective,
LeafletMarkerDirective,
LeafletPopupDirective,
LeafletMapComponent,
StringToLatLngZoomPipe
],
providers: [
{
provide: LEAFLET_CONFIGURATION_TOKEN,
useFactory: (config: IAppConfiguration) => config.leaflet,
deps: [APP_CONFIGURATION]
},
{
provide: LEAFLET_RESIZE_TOKEN,
useFactory: (service: SideMenuRegistrationService) => service.resize$,
deps: [SideMenuRegistrationService]
}
]
})
export class LeafletModule {
}