import { Component , Input , OnInit , ViewRef } from '@angular/core' ; import { HsAddDataCatalogueMapService } from '../catalogue-map.service' ; import { HsAddDataCatalogueService } from '../catalogue.service' ; import { HsAddDataLayerDescriptor } from '../layer-descriptor.model' ; import { HsConfig } from '../../../../config.service' ; import { HsDialogComponent } from '../../../layout/dialogs/dialog-component.interface' ; import { HsDialogContainerService } from '../../../layout/dialogs/dialog-container.service' ; import { HsEndpoint } from '../../../../common/endpoints/endpoint.interface' ; @ Component ( { selector : 'hs-catalogue-metadata' , templateUrl : './catalogue-metadata.component.html' , } ) export class HsCatalogueMetadataComponent implements HsDialogComponent , OnInit { @ Input ( ) data ; selectedLayer ; selectedLayerKeys ; selectedDS ; viewRef : ViewRef ; constructor ( public hsConfig , public hsAddDataCatalogueService , public hsAddDataCatalogueMapService , public hsDialogContainerService ) { } ngOnInit ( ) { this . selectedDS = this . data . selectedDS ; this . selectedLayer = this . data . selectedLayer ; this . selectedLayerKeys = Object . keys ( this . selectedLayer ) ; this . selectedLayerKeys = this . selectedLayerKeys . filter ( ( e ) => e !== 'endpoint' ) ; } param ds param layer param type addLayerToMap ( ds , layer , type ) { this . hsAddDataCatalogueService . addLayerToMap ( ds , layer , type ) ; this . close ( ) ; } close ( ) { this . hsDialogContainerService . destroy ( this ) ; } }