import { AfterContentInit , Component , Input } from '@angular/core' ; import { HsAddDataCommonService } from '../../common.service' ; import { HsAddDataService } from '../../../add-data.service' ; import { HsAddDataUrlService } from '../../../url/add-data-url.service' ; import { HsLanguageService } from '../../../../language/language.service' ; import { HsLayerUtilsService } from '../../../../utils/layer-utils.service' ; import { HsUrlWmsService } from '../../../url/wms/wms.service' ; import { HsUtilsService } from '../../../../utils/utils.service' ; @ Component ( { selector : 'hs-url-details' , templateUrl : './details.component.html' , } ) export class HsUrlDetailsComponent implements AfterContentInit { @ Input ( ) injectedService : any ; @ Input ( ) type : string ; data ; checkedSubLayers = { } ; hasNestedLayers : any ; getDimensionValues : any ; limitShown = 100 ; constructor ( public hsAddDataUrlService , public hsUtilsService , public hsLayerUtilsService , public hsAddDataService , public hsLanguageService , public hsUrlWmsService , public hsAddDataCommonService ) { } ngAfterContentInit ( ) { this . hsAddDataUrlService . hasAnyChecked = false ; this . data = this . injectedService . data ; this . hasNestedLayers = this . hsLayerUtilsService . hasNestedLayers ; this . getDimensionValues = this . hsAddDataCommonService . getDimensionValues ; } srsChanged ( ) { this . data . resample_warning = this . hsAddDataCommonService . srsChanged ( this . data . srs ) ; } searchForChecked ( service ) { this . checkedSubLayers [ service . Name ] = service . checked ; this . hsAddDataUrlService . hasAnyChecked = Object . values ( this . checkedSubLayers ) . some ( ( value ) => value === true ) ; } reachedLimit ( ) { if ( this . data . services ?. length > this . limitShown ) { return true ; } else { return false ; } } changed ( ) { this . hsAddDataUrlService . searchForChecked ( this . data . services ) ; } }