import { Layer } from 'ol/layer' ; import { Source } from 'ol/source' ; import { HsLaymanLayerDescriptor } from './layman-layer-descriptor.interface' ; import { getName , getTitle } from '../../common/layer-extensions' ; export const PREFER_RESUMABLE_SIZE_LIMIT = 2 * 1024 * 1024 ; param title returns export function getLaymanFriendlyLayerName ( title ) { title = title . toLowerCase ( ) . replace ( /[^\w\s\-\.]/gm , '' ) . trim ( ) . replace ( /[\s\-\._]+/gm , '_' ) . replace ( /[^\x00-\x7F]/g , '' ) ; return title ; } param layer export function getLayerName ( layer ) { const layerName = getName ( layer ) || getTitle ( layer ) ; if ( layerName == undefined ) { this . $log . warn ( 'Layer title/name not set for' , layer ) ; } return getLaymanFriendlyLayerName ( layerName ) ; } export function wfsNotAvailable ( descr ) { return descr . wfs ?. status == 'NOT_AVAILABLE' ; } export function wfsPendingOrStarting ( descr ) { return descr . wfs ?. status == 'PENDING' || descr . wfs ?. status == 'STARTED' ; } export function wfsFailed ( descr ) { return descr . wfs ?. status == 'FAILURE' ; }