File

app.component.ts

Description

Main entrypoint for the data mapping application.

Show vairous layers associated with a NSHM using Leaflet.

See https://leafletjs.com/

Implements

OnInit

Metadata

Index

Properties
Methods

Constructor

constructor(service: AppService, headerService: HeaderService)
Parameters :
Name Type Optional
service AppService No
headerService HeaderService No

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

controlsSubscription
Type : Subscription

Subscirption on controls change

navigationList
Default value : navigation()

Navigation list for meny

Public service
Type : AppService
title
Default value : apps().source.data.display

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>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""