@itwin/core-frontend
Version:
iTwin.js frontend components
109 lines • 4.04 kB
TypeScript
/** @packageDocumentation
* @module MapLayers
*/
import { DeprecatedBackgroundMapProps, ImageMapLayerSettings, MapSubLayerProps } from "@itwin/core-common";
import { IModelConnection } from "../../IModelConnection";
import { MapLayerSourceValidation } from "../internal";
/** Values for return codes from [[MapLayerSource.validateSource]]
* @public
*/
export declare enum MapLayerSourceStatus {
/** Layer source is valid */
Valid = 0,
/** Authorization has failed when accessing this layer source. */
InvalidCredentials = 1,
/** Provided format id could not be resolved in [[MapLayerFormatRegistry]] */
InvalidFormat = 2,
/** The tiling schema of the source is not supported */
InvalidTileTree = 3,
/** Could not not connect to remote server using the provided URL.*/
InvalidUrl = 4,
/** Authorization is required to access this map layer source. */
RequireAuth = 5,
/** Map-layer coordinate system is not supported */
InvalidCoordinateSystem = 6,
/** Format is not compatible with the URL provided.
*/
IncompatibleFormat = 7
}
/** JSON representation of a map layer source.
* @see [ImageryMapLayerFormatId]($common)
* @public
*/
export interface MapLayerSourceProps {
/** Identifies the map layers source. Defaults to 'WMS'. */
formatId?: string;
/** Name */
name: string;
/** URL of the source's endpoint. */
url: string;
/** True to indicate background is transparent. Defaults to 'true'. */
transparentBackground?: boolean;
/** Indicate if this source definition should be used as a base map. Defaults to false. */
baseMap?: boolean;
/** List of query parameters that will get appended to the source.
* @beta
*/
queryParams?: {
[key: string]: string;
};
}
/** A source for map layers. These may be catalogued for convenient use by users or applications.
* @public
*/
export declare class MapLayerSource {
formatId: string;
name: string;
url: string;
baseMap: boolean;
transparentBackground?: boolean;
userName?: string;
password?: string;
/** List of query parameters that will get appended to the source URL that should be be persisted part of the JSON representation.
* @beta
*/
savedQueryParams?: {
[key: string]: string;
};
/** List of query parameters that will get appended to the source URL that should *not* be be persisted part of the JSON representation.
* @beta
*/
unsavedQueryParams?: {
[key: string]: string;
};
private constructor();
static fromJSON(json: MapLayerSourceProps): MapLayerSource | undefined;
validateSource(ignoreCache?: boolean): Promise<MapLayerSourceValidation>;
/** @internal*/
static fromBackgroundMapProps(props: DeprecatedBackgroundMapProps): MapLayerSource | undefined;
toJSON(): Omit<MapLayerSourceProps, "formatId"> & {
formatId: string;
};
toLayerSettings(subLayers?: MapSubLayerProps[]): ImageMapLayerSettings | undefined;
private getCredentials;
/** Collect all query parameters
* @beta
*/
collectQueryParams(): {
[key: string]: string;
};
}
/** A collection of [[MapLayerSource]] objects.
* @beta
*/
export declare class MapLayerSources {
private _sources;
private static _instance?;
private constructor();
static getInstance(): MapLayerSources | undefined;
findByName(name: string, baseMap?: boolean): MapLayerSource | undefined;
get layers(): MapLayerSource[];
get allSource(): MapLayerSource[];
get bases(): MapLayerSource[];
private static getBingMapLayerSource;
private static getMapBoxLayerSource;
static create(iModel?: IModelConnection, queryForPublicSources?: boolean, addMapBoxSources?: boolean): Promise<MapLayerSources>;
static addSourceToMapLayerSources(mapLayerSource?: MapLayerSource): Promise<MapLayerSources | undefined>;
static removeLayerByName(name: string): boolean;
}
//# sourceMappingURL=MapLayerSources.d.ts.map