@itwin/core-frontend
Version:
iTwin.js frontend components
119 lines • 5.56 kB
TypeScript
import { MapCartoRectangle, MapLayerAccessClient, MapLayerAccessToken, MapLayerAccessTokenParams, MapLayerSource, MapLayerSourceStatus, MapLayerSourceValidation, ValidateSourceArgs } from "../../../tile/internal";
/**
* Class representing an ArcGIS error code.
* @internal
*/
export declare enum ArcGisErrorCode {
InvalidCredentials = 401,
MissingPermissions = 403,
InvalidToken = 498,
TokenRequired = 499,
UnknownError = 1000,
NoTokenService = 1001
}
/**
* Class representing an ArcGIS service metadata.
* @internal
*/
export interface ArcGISServiceMetadata {
/** JSON content from the service */
content: any;
/** Indicates if an access token is required to access the service */
accessTokenRequired: boolean;
}
/** Arguments for validating ArcGIS sources * @internal
*/
export interface ArcGisValidateSourceArgs extends ValidateSourceArgs {
/** List of capabilities 'keyword' that needs to be advertised in the service's metadata in order to be valid. For example: 'Map', 'Query', etc*/
capabilitiesFilter: string[];
}
/** Arguments for fetching service metadata * @internal
*/
export interface ArcGisGetServiceJsonArgs {
url: string;
formatId: string;
userName?: string;
password?: string;
queryParams?: {
[key: string]: string;
};
ignoreCache?: boolean;
requireToken?: boolean;
}
/**
* Class containing utilities relating to ArcGIS services and coordinate systems.
* @internal
*/
export declare class ArcGisUtilities {
private static getBBoxString;
static getNationalMapSources(): Promise<MapLayerSource[]>;
static getServiceDirectorySources(url: string, baseUrl?: string): Promise<MapLayerSource[]>;
/**
* Get map layer sources from an ArcGIS query.
* @param range Range for the query.
* @param url URL for the query.
* @returns List of map layer sources.
*/
static getSourcesFromQuery(range?: MapCartoRectangle, url?: string): Promise<MapLayerSource[]>;
/**
* Parse the URL to check if it represents a valid ArcGIS service
* @param url URL to validate.
* @param serviceType Service type to validate (i.e FeatureServer, MapServer)
* @return Validation Status.
*/
static validateUrl(url: string, serviceType: string): MapLayerSourceStatus;
/**
* Attempt to access an ArcGIS service, and validate its service metadata.
* @param source Source to validate.
* @param opts Validation options
*/
static validateSource(args: ArcGisValidateSourceArgs): Promise<MapLayerSourceValidation>;
/** Validate MapService tiling metadata and checks if the tile tree is 'Google Maps' compatible. */
static isEpsg3857Compatible(tileInfo: any): boolean;
private static _serviceCache;
/**
* Fetches an ArcGIS service metadata, and returns its JSON representation.
* If an access client has been configured for the specified formatId,
* it will be used to apply required security token.
* By default, response for each URL are cached.
* @param url URL of the ArcGIS service
* @param formatId Format ID of the service
* @param userName Username to use for legacy token based security
* @param password Password to use for legacy token based security
* @param ignoreCache Flag to skip cache lookup (i.e. force a new server request)
* @param requireToken Flag to indicate if a token is required
*/
static getServiceJson(args: ArcGisGetServiceJsonArgs): Promise<ArcGISServiceMetadata | undefined>;
/** Read a response from ArcGIS server and check for error code in the response. */
static checkForResponseErrorCode(response: Response): Promise<number | undefined>;
static appendSecurityToken(url: URL, accessClient: MapLayerAccessClient, accessTokenParams: MapLayerAccessTokenParams): Promise<MapLayerAccessToken | undefined>;
/**
* Compute scale, resolution values for requested zoom levels (WSG 84)
* Use a scale of 96 dpi for Google Maps scales
* Based on this article: https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Resolution_and_Scale
* @param startZoom Zoom level where scales begins to be computed
* @param endZoom Zoom level where scales ends to be computed
* @param latitude Latitude in degrees to use to compute scales (i.e 0 for Equator)
* @param tileSize Size of a tile in pixels (i.e 256)
* @param screenDpi Monitor resolution in dots per inch (i.e. typically 96dpi is used by Google Maps)
* @returns An array containing resolution and scale values for each requested zoom level
*/
static computeZoomLevelsScales(startZoom?: number, endZoom?: number, latitude?: number, tileSize?: number, screenDpi?: number): {
zoom: number;
resolution: number;
scale: number;
}[];
/**
* Match the provided minScale, maxScale values to corresponding wgs84 zoom levels
* @param defaultMaxLod Value of the last LOD (i.e 22)
* @param tileSize Size of a tile in pixels (i.e 256)
* @param minScale Minimum scale value that needs to be matched to a LOD level
* @param maxScale Maximum scale value that needs to be matched to a LOD level
* @returns minLod: LOD value matching minScale, maxLod: LOD value matching maxScale
*/
static getZoomLevelsScales(defaultMaxLod: number, tileSize: number, minScale?: number, maxScale?: number, tolerance?: number): {
minLod?: number;
maxLod?: number;
};
}
//# sourceMappingURL=ArcGisUtilities.d.ts.map