UNPKG

@elastic/ems-client

Version:

JavaScript client library for the Elastic Maps Service

78 lines (77 loc) 2.82 kB
import { DataDrivenPropertyValueSpecification, FormattedSpecification, LayerSpecification, StyleSpecification, VectorSourceSpecification } from 'maplibre-gl'; import { EMSClient, TMSServiceConfig } from './ems_client'; import { AbstractEmsService } from './ems_service'; import { layerPaintProperty, blendMode, mbColorDefinition } from './utils'; export type EmsSprite = { height: number; pixelRatio: number; width: number; x: number; y: number; sdf?: boolean; }; export type EmsSpriteSheet = { [spriteName: string]: EmsSprite; }; type EmsVectorSources = { [sourceName: string]: VectorSourceSpecification; }; type EmsVectorStyle = StyleSpecification & { sources: EmsVectorSources; }; type EmsRasterStyle = { tilejson: string; name: string; attribution: string; minzoom: number; maxzoom: number; bounds: number[]; format: string; type: string; tiles: string[]; center: number[]; }; export declare class TMSService extends AbstractEmsService { static SupportedLanguages: { key: string; omt: string; }[]; static colorOperationDefaults: { style: string; operation: blendMode; percentage: number; }[]; protected readonly _config: TMSServiceConfig; private _getRasterStyleJson; private _getVectorStyleJsonRaw; private _getVectorStyleJsonInlined; constructor(config: TMSServiceConfig, emsClient: EMSClient, proxyPath: string); static transformLanguageProperty(layer: LayerSpecification, lang: string): DataDrivenPropertyValueSpecification<FormattedSpecification> | undefined; static transformColorProperties(layer: LayerSpecification, color?: string, operation?: blendMode, percentage?: number): { property: keyof layerPaintProperty; color: mbColorDefinition | undefined; }[]; private static _getTextField; getDefaultRasterStyle(): Promise<EmsRasterStyle | undefined>; getUrlTemplate(): Promise<string>; getUrlTemplateForVector(sourceId: string): Promise<string>; getVectorStyleSheet(): Promise<EmsVectorStyle | undefined>; getVectorStyleSheetRaw(): Promise<EmsVectorStyle | undefined>; getSpriteSheetMeta(isRetina?: boolean): Promise<{ png: string; json: EmsSpriteSheet; } | undefined>; getSpriteSheetJsonPath(isRetina?: boolean): Promise<string>; getSpriteSheetPngPath(isRetina?: boolean): Promise<string>; getDisplayName(): string; getMinZoom(format?: string): Promise<number | undefined>; getMaxZoom(format?: string): Promise<number | undefined>; getId(): string; hasId(id: string): boolean; getApiUrl(): string; private _getStyleUrlForLocale; private _getFormats; private _getSpriteSheetRootPath; private _getUrlTemplateForGlyphs; } export {};