CutAnalysis
A spatial analysis object for cut analysis, used to perform cut analysis on a 3D scene.
It defines a cut plane (a cuboid region) with position, rotation and scale, and hides the parts outside the cut region so the inside of the model can be inspected. It is usually combined with TransformControl for interactive adjustment of the cut plane (verified against the 2026 source).
Constructor
import { CutAnalysis } from '@maptalks/gl-layers';
const cutAnalysis = new CutAnalysis({
position: [center.x, center.y, 10],
rotation: [45, 0, 0],
scale: [8, 8, 8]
});
cutAnalysis.addTo(groupGLLayer);Details
- options* Object configuration options, the available options are as follows:
| Option | Type | Description | Default |
|---|---|---|---|
| position* | Number[] | Position of the cut region, [x, y, h]; x and y are longitude/latitude and h is the altitude | null |
| rotation | Number[] | Euler angles of the cut region | [0, 0, 0] |
| scale | Number[] | Scale of the cut region | [1, 1, 1] |
Member Methods
reset()
Resets the cut plane to its initial position, rotation and scale (added after cross-checking the 2026 source code).
Returns:
- void
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)