s2maps-gpu
Version:
S2 Maps GPU - An open source, high-performance, and GPU-accelerated map engine for rendering large-scale, interactive maps.
91 lines (90 loc) • 3.97 kB
TypeScript
import Workflow, { Feature } from './workflow.js';
import type Context from '../context/context.js';
import type { HillshadeData } from 'workers/worker.spec.js';
import type { TileGL as Tile } from 'source/tile.spec.js';
import type { ColorArray, HillshadeDefinition, HillshadeStyle, HillshadeWorkflowLayerGuide, LayerDefinitionBase } from 'style/style.spec.js';
import type { HillshadeFeature as HillshadeFeatureSpec, HillshadeWorkflow as HillshadeWorkflowSpec, HillshadeWorkflowUniforms, RasterSource } from './workflow.spec.js';
/** Hillshade Feature is a standalone hillshade render storage unit that can be drawn to the GPU */
export declare class HilllshadeFeature extends Feature implements HillshadeFeatureSpec {
workflow: HillshadeWorkflowSpec;
layerGuide: HillshadeWorkflowLayerGuide;
tile: Tile;
source: RasterSource;
fadeStartTime: number;
parent?: Tile | undefined;
type: "hillshade";
opacity?: number;
shadowColor?: ColorArray;
accentColor?: ColorArray;
highlightColor?: ColorArray;
azimuth?: number;
altitude?: number;
/**
* @param workflow - the hillshade workflow
* @param layerGuide - layer guide for this feature
* @param tile - the tile that the feature is drawn on
* @param source - the raster source
* @param fadeStartTime - the start time of the fade
* @param parent - the parent tile
*/
constructor(workflow: HillshadeWorkflowSpec, layerGuide: HillshadeWorkflowLayerGuide, tile: Tile, source: RasterSource, fadeStartTime?: number, parent?: Tile | undefined);
/**
* Draw the feature to the GPU
* @param interactive - whether or not the feature is interactive
*/
draw(interactive?: boolean): void;
/**
* Duplicate this feature
* @param tile - the tile that the feature is drawn on
* @param parent - the parent tile if applicable
* @returns the duplicated feature
*/
duplicate(tile: Tile, parent?: Tile): HilllshadeFeature;
/**
* Set the attributes of the feature if the context is webgl1
* @param opacity - the opacity
* @param shadowColor - the shadow color
* @param accentColor - the accent color
* @param highlightColor - the highlight color
* @param azimuth - the azimuth
* @param altitude - the altitude
*/
setWebGL1Attributes(opacity?: number, shadowColor?: ColorArray, accentColor?: ColorArray, highlightColor?: ColorArray, azimuth?: number, altitude?: number): void;
/**
* Set the attributes of the feature if the context is webgl1
* @param code - the code
*/
setWebGL1AttributesCode(code: number[]): void;
}
/** Hillshade Workflow */
export default class HillshadeWorkflow extends Workflow implements HillshadeWorkflowSpec {
#private;
label: "hillshade";
layerGuides: Map<number, HillshadeWorkflowLayerGuide>;
uniforms: {
[key in HillshadeWorkflowUniforms]: WebGLUniformLocation;
};
/** @param context - the WebGL(1|2) context */
constructor(context: Context);
/**
* Build the hillshade source
* @param hillshadeData - the hillshade data sent from the Tile Worker
* @param tile - the tile that the feature is drawn on
*/
buildSource(hillshadeData: HillshadeData, tile: Tile): void;
/**
* Build the layer definition
* @param layerBase - the common layer attributes
* @param layer - the user defined layer attributes
* @returns a built layer definition that's ready to describe how to render a feature
*/
buildLayerDefinition(layerBase: LayerDefinitionBase, layer: HillshadeStyle): HillshadeDefinition;
/** Use this workflow as the current shaders for the GPU */
use(): void;
/**
* Draw the hillshade feature
* @param feature - the feature guide
* @param _interactive - whether or not the feature is interactive
*/
draw(feature: HillshadeFeatureSpec, _interactive?: boolean): void;
}