Skip to content

ExcavateAnalysis

A spatial analysis object for excavate analysis, used to perform excavate analysis on a 3D scene.

It delimits a region with a polygon boundary (boundary), "digs out" part of the model, and reveals the bottom face (textured with textureUrl at a given height).

Note: ExcavateAnalysis does not extend Analysis. It extends ExtrudePolygonLayer from @maptalks/vt (with the ExcavateRenderer registered as both the gl and gpu renderers), so it is itself a WebGL layer: it is added to a GroupGLLayer with addTo(groupGLLayer), and excavate(layers) is used to specify the layers to be excavated (verified against the 2026 source).

Constructor

js
import { ExcavateAnalysis } from '@maptalks/gl-layers';

const excavateAnalysis = new ExcavateAnalysis('excavate', {
  boundary: [
    [121.10, 39.20],
    [121.11, 39.20],
    [121.11, 39.21],
    [121.10, 39.21],
    [121.10, 39.20]
  ],
  textureUrl: './textures/ground.jpg',
  height: 10
});

excavateAnalysis.addTo(groupGLLayer);
Details
Parameters:
  • id* String the layer id
  • options* Object configuration options, the available options are as follows:
OptionTypeDescriptionDefault
boundary*Array<Array>The coordinate rings of the excavate boundary (added after cross-checking the 2026 source code)null
textureUrlStringThe url of the texture of the excavate bottom (mentioned in the README)null
heightNumberExcavate height in meters (`z

Member Methods

excavate(layers)

Specifies the layers to be excavated; updates the height map and redraws.

Parameters:

  • layers Layer[] | Layer the layer(s) to be excavated

Returns:

  • void
getExcavatedLayers()

Gets the excavated layers.

Returns:

  • Layer[]
enable()

Enables the excavate effect.

Returns:

  • void
disable()

Disables the excavate effect.

Returns:

  • void
isEnable()

Whether the excavate effect is enabled.

Returns:

  • Boolean

Methods Inherited from ExtrudePolygonLayer

ExcavateAnalysis inherits all layer methods and options of ExtrudePolygonLayer (and further of PolygonLayer).

This document has been cross-checked against the @maptalks/gl-layers 2026 source (api-notes-others.md / api-notes-vt-gl.md)