/** @packageDocumentation * @module DisplayStyles */ import { BackgroundMapSettings } from "./BackgroundMapSettings"; /** @beta */ export declare type SubLayerId = string | number; /** JSON representation of the settings associated with a map sublayer included within a [[MapLayerProps]]. * A map sub layer represents a set of objects within the layer that can be controlled separately. These * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers. * @see [[MapLayerProps]] * @beta */ export interface MapSubLayerProps { name?: string; title?: string; visible?: boolean; id?: SubLayerId; parent?: SubLayerId; children?: SubLayerId[]; } /** Normalized representation of a [[MapSubLayerProps]] for which values * have been validated and default values have been applied where explicit values not defined. * A map sub layer represents a set of objects within the layer that can be controlled separately. These * are produced only from map servers that produce images on demand and are not supported by tiled (cached) servers. * This class can represent an hierarchy, in this case a sub layer is visible only if all its ancestors are also visible. * @see [[MapLayerSettings]] * @beta */ export declare class MapSubLayerSettings { /** Typically Name is a single word used for machine-to-machine communication while the Title is for the benefit of humans (WMS) */ readonly name: string; /** Title. */ readonly title?: string; /** If true the sub layer is visible. If part of a hierarchy, a sub layer is visible only if its ancestors are also visible. */ readonly visible: boolean; /** A unique string or number that may be used to identify the sub layer (ArcGIS) */ readonly id: SubLayerId; /** One or more sublayer children */ readonly children?: SubLayerId[]; /** sublayer parent. */ readonly parent?: SubLayerId; constructor(name: string, title?: string, visible?: boolean, id?: SubLayerId, parent?: SubLayerId, children?: SubLayerId[]); /** Construct from JSON, performing validation and applying default values for undefined fields. */ static fromJSON(json: MapSubLayerProps): MapSubLayerSettings | undefined; toJSON(): MapSubLayerProps; /** Creating a copy of this MapSubLayer, optionally modifying some if its properties */ clone(changedProps: MapSubLayerProps): MapSubLayerSettings; /** @internal */ displayMatches(other: MapSubLayerSettings): boolean; /** return true if this sublayer is named. */ get isNamed(): boolean; /** return true if this sublayer is a leaf (has no children) */ get isLeaf(): boolean; /** return true if this sublayer is an unnamed group */ get isUnnamedGroup(): boolean; /** return a string representing this sublayer id (converting to string if underlying id is number) */ get idString(): string; } /** JSON representation of the settings associated with a map layer. One or more map layers may be included within a [[MapImageryProps]] object. * @see [[MapImageryProps]] * @beta */ export interface MapLayerProps { /** Controls visibility of layer. Defaults to 'true'. */ visible?: boolean; /** Identifies the map layers source. Defaults to 'WMS'. */ formatId?: string; /** Name */ name?: string; /** URL */ url?: string; /** Source layers. If undefined all layers are displayed. */ subLayers?: MapSubLayerProps[]; /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, * or false to indicate the transparency should not be overridden. Default value: 0. * If omitted, defaults to 0. */ transparency?: number; /** True to indicate background is transparent. Defaults to 'true'. */ transparentBackground?: boolean; /** Is a base layer. Defaults to 'false'. */ isBase?: boolean; /** Access Key for the Layer, like a subscription key or access token */ accessKey?: MapLayerKey; } /** * stores key-value pair to be added to all requests made involving map layer. * @beta */ export interface MapLayerKey { key: string; value: string; } /** Normalized representation of a [[MapLayerProps]] for which values have been validated and default values have been applied where explicit values not defined. * One or more map layers may be included within [[MapImagerySettings]] object. * @see [[MapImagerySettings]] * @beta */ export declare class MapLayerSettings { readonly visible: boolean; readonly formatId: string; readonly name: string; readonly url: string; readonly transparency: number; readonly subLayers: MapSubLayerSettings[]; readonly transparentBackground: boolean; readonly isBase: boolean; userName?: string; password?: string; readonly accessKey?: MapLayerKey; setCredentials(userName?: string, password?: string): void; private constructor(); /** Construct from JSON, performing validation and applying default values for undefined fields. */ static fromJSON(json?: MapLayerProps): MapLayerSettings | undefined; /** return JSON representation of this MapLayerSettings object */ toJSON(): MapLayerProps; /** @internal */ private static mapTypeName; /** Create a [[MapLayerSettings]] object from the image settings within a [[BackgroundMapSettings]] object (providerName and mapType). */ static fromMapSettings(mapSettings: BackgroundMapSettings): MapLayerSettings; /** Create a copy of this MapLayerSettings, optionally modifying some of its properties. * @param changedProps JSON representation of the properties to change. * @returns A MapLayerSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`. */ clone(changedProps: MapLayerProps): MapLayerSettings; /** @internal */ displayMatches(other: MapLayerSettings): boolean; /** @internal */ matchesNameAndUrl(name: string, url: string): boolean; /** Return a sublayer matching id -- or undefined if not found */ subLayerById(id?: SubLayerId): MapSubLayerSettings | undefined; private hasInvisibleAncestors; /** Return true if sublayer is visible -- testing ancestors for visibility if they exist. */ isSubLayerVisible(subLayer: MapSubLayerSettings): boolean; /** Return true if all sublayers are visible. */ get allSubLayersInvisible(): boolean; /** Return the children for a sublayer */ getSubLayerChildren(subLayer: MapSubLayerSettings): MapSubLayerSettings[] | undefined; } //# sourceMappingURL=MapLayerSettings.d.ts.map