app.component.ts
Main entrypoint for the data mapping application.
Show vairous layers associated with a NSHM using Leaflet.
OnInit
encapsulation | ViewEncapsulation.None |
selector | app-app |
imports |
NshmpLibNgTemplateComponent
NshmpTemplateContentContainerComponent
NshmpTemplateControlPanelComponent
NshmpTemplateMainContentComponent
NshmpTemplateSettingsComponent
NshmpLibNgHazardProvisionalModelComponent
NshmpLibNgAboutPageComponent
ControlPanelComponent
MapComponent
PlotSettingsPanelComponent
InfoPopupComponent
AboutComponent
|
templateUrl | ./app.component.html |
styleUrl | ./app.component.scss |
Properties |
Methods |
constructor(service: AppService, headerService: HeaderService)
|
|||||||||
Defined in app.component.ts:56
|
|||||||||
Parameters :
|
ngOnInit |
ngOnInit()
|
Defined in app.component.ts:69
|
Returns :
void
|
controlsSubscription |
Type : Subscription
|
Defined in app.component.ts:52
|
Subscirption on controls change |
navigationList |
Default value : navigation()
|
Defined in app.component.ts:54
|
Navigation list for meny |
Public service |
Type : AppService
|
Defined in app.component.ts:59
|
title |
Default value : apps().source.data.display
|
Defined in app.component.ts:56
|
Application title |
import {Component, effect, OnInit, ViewEncapsulation} from '@angular/core';
import {NshmpLibNgAboutPageComponent} from '@ghsc/nshmp-lib-ng/about';
import {NshmpLibNgHazardProvisionalModelComponent} from '@ghsc/nshmp-lib-ng/hazard';
import {NshmpLibNgTemplateComponent} from '@ghsc/nshmp-lib-ng/nshmp';
import {
HeaderService,
NshmpTemplateContentContainerComponent,
NshmpTemplateControlPanelComponent,
NshmpTemplateMainContentComponent,
NshmpTemplateSettingsComponent,
} from '@ghsc/nshmp-template';
import {apps} from 'projects/nshmp-apps/src/shared/utils/applications.utils';
import {navigation} from 'projects/nshmp-apps/src/shared/utils/navigation.utils';
import {Subscription} from 'rxjs';
import {AboutComponent} from './components/about/about.component';
import {ControlPanelComponent} from './components/control-panel/control-panel.component';
import {InfoPopupComponent} from './components/info-popup/info-popup.component';
import {MapComponent} from './components/map/map.component';
import {PlotSettingsPanelComponent} from './components/plot-settings-panel/plot-settings-panel.component';
import {AppService} from './services/app.service';
/**
* Main entrypoint for the data mapping application.
*
* Show vairous layers associated with a NSHM using Leaflet.
*
* @see https://leafletjs.com/
*/
@Component({
encapsulation: ViewEncapsulation.None,
imports: [
NshmpLibNgTemplateComponent,
NshmpTemplateContentContainerComponent,
NshmpTemplateControlPanelComponent,
NshmpTemplateMainContentComponent,
NshmpTemplateSettingsComponent,
NshmpLibNgHazardProvisionalModelComponent,
NshmpLibNgAboutPageComponent,
ControlPanelComponent,
MapComponent,
PlotSettingsPanelComponent,
InfoPopupComponent,
AboutComponent,
],
selector: 'app-app',
styleUrl: './app.component.scss',
templateUrl: './app.component.html',
})
export class AppComponent implements OnInit {
/** Subscirption on controls change */
controlsSubscription: Subscription;
/** Navigation list for meny */
navigationList = navigation();
/** Application title */
title = apps().source.data.display;
constructor(
public service: AppService,
private headerService: HeaderService,
) {
effect(() => {
this.headerService.controlPanelSelected();
this.headerService.settingsSelected();
this.service.mapRedraw();
});
}
ngOnInit() {
this.service.init();
}
}
<nshmp-lib-ng-template [navigationList]="navigationList" [title]="title">
<nshmp-template-content-container>
<nshmp-template-control-panel>
<app-control-panel />
</nshmp-template-control-panel>
<nshmp-template-main-content>
<app-map />
</nshmp-template-main-content>
<nshmp-template-settings>
<app-plot-settings-panel />
</nshmp-template-settings>
</nshmp-template-content-container>
<!-- Popup for clicked feature on map -->
<app-info-popup />
<!-- Provisional model warning -->
<nshmp-lib-ng-hazard-provisional-model
[name]="service.treesUsageResponse()?.response?.model?.name"
/>
<!-- About page -->
<nshmp-lib-ng-about-page>
<app-about />
</nshmp-lib-ng-about-page>
</nshmp-lib-ng-template>