@maptiler/weather
Version:
Weather layers for MapTiler Cloud and MapTiler SDK
113 lines (112 loc) • 3.45 kB
TypeScript
import { ColoringFragmentBase } from '../../core/ColoringFragment';
import { TileLayer, TileLayerOptions } from '../TileLayer';
import { ParticleLayerOptions } from './type';
/**
* Extended version of {@link TileLayer}, which does particle-based animation on top the data.
*
* The standard raster visualization of {@link TileLayer} can be used simultanously over the same data.
*/
declare class ParticleLayer extends TileLayer {
private rttScene;
private rttCamera;
private rttMaterial;
private rttMesh;
private particleTexturePrev;
private particleTexture0;
private particleTexture1;
private particleMaterial;
private particles;
private particleBackground;
private accumulator;
private accumulatorDrawMesh;
private flipFlop;
private numParticles;
private particleDensity;
private refreshInterval;
private fadeFactor;
private particleColor;
private particleFastColor;
private particleFastSpeed;
private particleSize;
private drawAsLines;
private particleSpeed;
private pixelRatio;
private prevRenderTime;
private lastRenderTime;
private forceRender;
private rttTimestep;
private tileGridPass;
private particlesTexturePreview;
/**
* @param id Unique identifier of the layer in the map.
* @param options
* @param particleOptions
* @param coloringFragments If not null, the same data will also be displayed as raster.
*/
constructor(id: string, options: TileLayerOptions | null, particleOptions: ParticleLayerOptions | null, coloringFragments?: ColoringFragmentBase[] | null);
/**
* TODO: Add description
*/
initParticle(options: TileLayerOptions, particleOptions: ParticleLayerOptions, coloringFragments?: ColoringFragmentBase[] | null): void;
/**
* TODO: Add description
*/
private generateRandomizeParticleTexture;
/**
* TODO: Add description
*/
private randomizeParticles;
/**
* Returns the ratio between the number of actually visible particle
* (to statisfy the specified density) and the maximum amount (maxAmount).
*
* Value >1 mean that more particles would be utilized if availabe.
*
* Useful for debugging and fine-tuning client application.
*/
getParticleUtilization(): number;
/**
* TODO: Add description
*/
setOpacity(opacity: number): void;
/**
* TODO: Add description
*/
protected disposeObjects(): void;
/**
* Called in refresh method
* It is important for globe projection, especially for low zoom levels
*/
private updateRenderingSize;
/**
* Called by onMoveEnd in parent class.
*/
protected refresh(): void;
/**
* Called by prerender in parent class.
*/
protected prerenderInternal(): void;
/**
* TODO: Add description
*/
private refreshMercator;
/**
* TODO: Add description
*/
private prerenderInternalMercator;
/**
* Called by `refresh` method.
* Refresh logic is different for globe and mercator projection.
*/
private refreshGlobe;
/**
* Called by `prerenderInternal` method.
* Prerender logic is different for globe and mercator projection.
*/
private prerenderInternalGlobe;
/**
* Called by render in parent class.
*/
protected renderInternal(): void;
}
export { ParticleLayer };