UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

105 lines (104 loc) 4.92 kB
/// <reference types="luma.gl__webgl" /> import { TileLayer } from '@deck.gl/geo-layers/typed'; import { PMTilesTileSource } from '@loaders.gl/pmtiles'; import { Texture2DProps } from '@luma.gl/webgl'; import { DatasetType } from '@kepler.gl/constants'; import { LayerBaseConfig, LayerColorConfig, LayerHeightConfig, VisualChannel, VisConfigColorRange, VisConfigSelection, VisConfigBoolean, VisConfigInput, VisConfigRange, VisConfigNumber } from '@kepler.gl/types'; import { Datasets, KeplerTable as KeplerDataset } from '@kepler.gl/table'; import { GetTileDataDefaultProps, GetTileDataProps, GetTileDataOutput, DataSourceParams, KeplerRasterDataset, Tile2DHeader, PresetOption, CompleteSTACObject } from './types'; import { FindDefaultLayerPropsReturnValue } from '../layer-utils'; import { default as KeplerLayer, LayerBaseConfigPartial } from '../base-layer'; export declare const getNumRasterTilesBeingLoaded: () => number; export declare const LOAD_ELEVATION_AFTER_ZOOM = 8.9; export declare type RasterTileLayerVisConfigCommonSettings = { opacity: VisConfigNumber; enableTerrain: VisConfigBoolean; }; export declare type RasterTileLayerVisConfigSettings = RasterTileLayerVisConfigCommonSettings & { preset: VisConfigSelection; useSTACSearching: VisConfigBoolean; stacSearchProvider: VisConfigSelection; startDate: VisConfigInput; endDate: VisConfigInput; dynamicColor: VisConfigBoolean; colormapId: VisConfigSelection; colorRange: VisConfigColorRange; linearRescalingFactor: VisConfigRange; nonLinearRescaling: VisConfigBoolean; gammaContrastFactor: VisConfigNumber; sigmoidalContrastFactor: VisConfigNumber; sigmoidalBiasFactor: VisConfigNumber; saturationValue: VisConfigNumber; filterEnabled: VisConfigBoolean; filterRange: VisConfigRange; _stacQuery: VisConfigInput; singleBandName: VisConfigSelection; }; declare type RasterTileLayerMeta = { zRange: number[] | null; }; export default class RasterTileLayer extends KeplerLayer { visConfigSettings: RasterTileLayerVisConfigSettings; meta: RasterTileLayerMeta; /** Min bands image data value, based on the current viewport */ minViewportPixelValue: number; /** Max bands image data value, based on the current viewport */ maxViewportPixelValue: number; /** Memoized method that calculates data source params */ getDataSourceParams: (stac: CompleteSTACObject, preset: string, presetOptions: PresetOption) => DataSourceParams | null; constructor(props: any); static findDefaultLayerProps(dataset: KeplerDataset): FindDefaultLayerPropsReturnValue; get type(): string; get name(): string; get layerIcon(): KeplerLayer['layerIcon']; get supportedDatasetTypes(): DatasetType[]; get visualChannels(): Record<string, VisualChannel>; get requireData(): boolean; getDefaultLayerConfig(props: LayerBaseConfigPartial): LayerBaseConfig & Partial<LayerColorConfig & LayerHeightConfig>; getHoverData(): null; shouldRenderLayer(): boolean; formatLayerData(datasets: Datasets, oldLayerData?: any): { dataset?: undefined; tileSource?: undefined; } | { dataset: KeplerDataset<import("@kepler.gl/types").Field>; tileSource: PMTilesTileSource | null; }; updateLayerMeta(dataset: KeplerRasterDataset): void; /** * Run when adding a new dataset */ setInitialLayerConfig(dataset: KeplerDataset): RasterTileLayer; /** * Update zRange of viewport. This is necessary so that tiles in extruded mode are shown properly * at high elevations: https://github.com/foursquare/studio-monorepo/pull/1892/files * Derived from https://github.com/visgl/deck.gl/blob/8d824a4b836fee3bfebe6fc962e0f03d8c1dbd0d/modules/geo-layers/src/terrain-layer/terrain-layer.js#L173-L196 * * @param tiles Array of tiles in current viewport */ onViewportLoad(tiles: (Tile2DHeader | null)[]): void; /** * Update viewport-related minPxelValue and maxPixelValue * @param tiles - deck.gl tiles */ updateMinMaxPixelValue(tiles: (Tile2DHeader | null)[]): void; /** * Calculate min and max values of input raster band image properties * and update `minBandsValue` and `maxBandsValue` * @param images - raster band image properties * @return [min, max] pixel values for the tile */ getMinMaxPixelValues(images: Texture2DProps[] | null): [number, number]; renderLayer(opts: any): TileLayer<any>[]; private renderStacLayer; private renderPMTilesLayer; getTileData(props: GetTileDataProps): Promise<GetTileDataOutput>; getTileDataPMTiles(props: GetTileDataDefaultProps & { shouldLoadTerrain: boolean; metadata: { rasterTileServerUrls: string[]; }; globalBounds: DataSourceParams['globalBounds']; }, tileSource: any): Promise<any>; } export {};