HeightLimitAnalysis
A spatial analysis object for height-limit (excess-height detection) analysis, used to perform height-limit analysis on a 3D scene.
The parts exceeding limitHeight are highlighted with limitColor, reusing the water-surface rendering mechanism of FloodAnalysis (analysis type analysisType = 2).
Constructor
import { HeightLimitAnalysis } from '@maptalks/gl-layers';
const heightLimitAnalysis = new HeightLimitAnalysis({
limitHeight: 25,
limitColor: [1, 0.2, 0.2]
});
heightLimitAnalysis.addTo(groupGLLayer);Details
- options* Object configuration options, the available options are as follows:
| Option | Type | Description | Default |
|---|---|---|---|
| limitHeight* | Number | The height limit in meters | null |
| limitColor | Number[] | A 3-component normalized array; the color of the parts exceeding the limit (the source's DEFAULT_LIMIT_COLOR) | [0.8, 0.1, 0.1] |
| boundary | Number[] | Boundary coordinate ring of the analyzed area (optional; when not set, the whole scene is analyzed; inherited from FloodAnalysis) | null |
Methods Inherited from FloodAnalysis
HeightLimitAnalysis inherits from FloodAnalysis (including options such as waterHeight, waterColor, waterOpacity, and methods such as update and renderAnalysis, verified against the 2026 source).
Methods Inherited from Analysis
addTo(groupGLLayer)
Adds the analysis object to a GroupGLLayer.
Spatial analysis objects can only be added to a GroupGLLayer; they cannot be added to other WebGL layers.
Parameters:
- groupGLLayer GroupGLLayer the GroupGLLayer
Returns:
- this
remove()
Removes the spatial analysis object from the layer.
Returns:
- void
update(name, value)
Updates options data.
Parameters:
- name String the setting name
- value any the setting value
Returns:
- void
getAnalysisType()
Gets the type of the Analysis.
Returns:
- String
getDefines()
Internal method.
Returns the defines added to the shader when the Analysis is rendered.
Returns:
- Object
renderAnalysis(meshes)
Internal method.
Renders the spatial analysis scene (implemented by each analysis subclass) and returns the uniform variables required for rendering.
Parameters:
- meshes Mesh[] the scene meshes
Returns:
- Object
enable()
Enables the analysis.
Returns:
- void
disable()
Disables the analysis.
Returns:
- void
isEnable()
Whether the analysis is enabled.
Returns:
- Boolean
getExcludeLayers()
Gets the list of layer ids excluded from the analysis (these layers are ignored during the analysis).
Returns:
- String[]
setExcludeLayers(layerIds)
Sets the list of layer ids excluded from the analysis.
Parameters:
- layerIds String[] list of layer ids
Returns:
- void
exportAnalysisMap(meshes)
Exports the analysis result image (RGBA pixel data); returns null when the analysis is not enabled.
Parameters:
- meshes Mesh[] the scene meshes
Returns:
- Uint8Array
This document has been cross-checked against the @maptalks/gl-layers 2026 source (api-notes-others.md / api-notes-vt-gl.md)