import type mapboxgl from "mapbox-gl"; import { type XYZ } from "@metoceanapi/wxtiles-common/utils/wxtools"; import { WxLayer as InnerWxLayer } from "@metoceanapi/wxtiles-common/wxlayer/wxlayer"; import type { WxLngLat, WxTileInfo, WxRequestInit, WxLayerOptions } from "@metoceanapi/wxtiles-common/types"; import { FrameworkParentClass, type FrameworkOptions } from "./wxsourcetypes"; import type { WxDataSetManager } from "../wxAPI/WxDataSetManager"; export type WxLayer = InnerWxLayer; export declare const WxLayerBaseImplementation: { new (...args: any[]): { _animation: boolean; _animationSeed: number; _redrawRequested?: Promise | undefined; readonly wxdatasetManager: import("@metoceanapi/wxtiles-common/managers/BaseDatasetManager").BaseDatasetManager; getCurrentVariableMeta(): import("@metoceanapi/wxtiles-common/types").WxVariableMeta; getDatasetMeta(): import("@metoceanapi/wxtiles-common/types").WxDatasetMeta; getMetadata(): import("@metoceanapi/wxtiles-common/types").WxVariableMeta; getVariablesNames(): import("@metoceanapi/wxtiles-common/types").WxLayerVarsNames; clearCache(): void; getCache(): import("@metoceanapi/wxtiles-common/types").WxRasterDataCache; getCurrentStyleObjectCopy(): import("@metoceanapi/wxtiles-common/utils/wxtools").WxColorStyleStrict; getTime(): string; getAllTimes(): string[]; setTime(time?: import("@metoceanapi/wxtiles-common/types").WxDate | undefined, requestInit?: WxRequestInit | undefined, redraw?: boolean | undefined): Promise; preloadTime(time: import("@metoceanapi/wxtiles-common/types").WxDate, requestInit?: WxRequestInit | undefined): Promise; startAnimation(): void; stopAnimation(): Promise; setCoarseLevel(level?: number): Promise; unsetCoarseLevel(): Promise; setStyleByName(wxstyleName: string, reload?: boolean): Promise; updateCurrentStyleObject(style?: import("@metoceanapi/wxtiles-common/utils/wxtools").WxColorStyleWeak | undefined, reload?: boolean, requestInit?: WxRequestInit | undefined): Promise; _redrawTiles(): Promise; _reloadVisible(requestInit?: WxRequestInit | undefined, redraw?: boolean | undefined): Promise; coveringTiles(): XYZ[]; update(): void; _needUpdateDSManager: boolean; _loadTileHelper(coords: XYZ, requestInit?: WxRequestInit | undefined): Promise; id: string; _layer: InnerWxLayer; fire(type: T, data: import("@metoceanapi/wxtiles-common/types").WxEventType[T]): void; }; } & { new (frwOptions: FrameworkOptions, wxLayerOptions: WxLayerOptions): FrameworkParentClass; }; /** * A custom layer source implementation * It is used to load and display weather data from the WxTiles server. * **NOTE** * Dont use this directly, use {@link WxDataSetManager.createSourceLayer} instead * @example * ```ts const wxapi = new WxAPI({ 'http://dataserver.com' }); // Create a dataset manager (may be used for many layers from this dataset) const datasetName = 'gfs.global'; const wxdatasetManager = await wxapi.createDatasetManager(datasetName); // create a layer source // Scalar example.For vector variables use either of the vector components (e.g. 'wind.eastward.at-10m') const variable = 'air.temperature.at-2m'; const wxsource = wxdatasetManager.createSourceLayer({ variable }, { id: 'wxsource', attribution: 'WxTiles' }); //new WxTileSource(wxLayerOptions, mboxSourceOptions); * ``` */ export declare class WxTileSource extends WxLayerBaseImplementation implements mapboxgl.CustomSourceInterface { /** * Creates a new instance of the `WxTileSource` class. * @internal * @constructor * @param {WxLayerOptions} wxLayerOptions - The options for the {@link WxLayerBaseImplementation}. * @param {FrameworkOptions} frwOptions - The options for the framework. */ constructor(wxLayerOptions: WxLayerOptions, frwOptions: FrameworkOptions); /** * Get comprehensive information about the current point on the map. * @param {WxLngLat} lnglat - Coordinates of the point. * @param {any} anymap - map instance. * @returns {WxTileInfo | undefined } * */ getLayerInfoAtLatLon(lnglat: WxLngLat, anymap: any): WxTileInfo | undefined; /** * Reloads the visible tiles with new data. Used for time/particles animation. * @ignore * @param {WxRequestInit} requestInit The request options. * @returns {Promise} A promise that resolves when the tiles have been reloaded and redrawn. */ _reloadVisible(requestInit?: WxRequestInit, redraw?: boolean): Promise; /** * Returns an array of tile coordinates that cover the visible portion of the map. * **Note**: MBOX API reassign this func in "map.addSource" * @ignore * @returns {XYZ[]} - An array of tile coordinates. */ coveringTiles(): XYZ[]; /** * Updates/reloads the source layer with new data. * **Note**: MBOX API reassign this func in "map.addSource" * @ignore * @returns {void} */ update(): void; /** * Loads a tile with the given coordinates and request options. * Used by framework. Creates a representation of a tile for the framework. * It rethrows 'AbortError' errors. * It returns empty tile during datasetManager update or in case of any other error (e.g. network error, not found, etc.) * It tries to update datasetManager if e.reason === 'instance-not-found' and update the layer * * @internal * @param {XYZ} coords - The tile coordinates to be loaded. * @param {WxRequestInit} requestInit - The request options. * @returns {Promise} - A promise that resolves with the loaded tile. */ loadTile(coords: XYZ, requestInit?: WxRequestInit): Promise; /** * Called when the layer is removed from the map. * @internal * @param {any} map - The map instance. * @returns {void} */ onRemove(map: any): void; } //# sourceMappingURL=wxsource.d.ts.map