Skip to content

Style

styleThe method is used to configure the style of the layer. The same layer has differentshapegraphics, differentshapelayerstyleMethods accept different parameters.

layer.style({
  opacity: 0.5,
});

common

UniversalstyleParameters, parameters supported by all graphics.

style type describe default value
opacity number Graphic transparency 1

fill

shapeFills the plane with geometry.

style type describe default value
raisingHeight number Lifting height 0
opacityLinear IOpacityLinear transparent gradient /

opacityLinear

type IDir = 'in' | 'out';

interface IOpacityLinear {
  enable: false;
  dir: IDir;
}

extrude

shapefor extruded geometry.

style type describe default value
raisingHeight number Lifting height 0
heightfixed boolean Does the lifting height vary?zoomVariety false
topsurface boolean Whether to display the top true
sidesurface boolean Whether to display on the side true
sourceColor IColor Side bottom color /
targetColor IColor side top color /

extrusion

shapefor extruded geometry.

style type describe Whether to support data mapping default value
extrusionBase number Base height in meters support 0

linear

The geometry layer supports configuring gradient effects (sourceColor, targetColor), which will be overwritten after configuring the gradient effect.layer.colorMethod to set the color.

water

shapeis the water surface geometry.

style type describe default value
speed number water wave speed 0.5
waterTexture string water surface texture 0

waterTextureThe default value is ‘https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*EojwT4VzSiYAAAAAAAAAAAAAARQnAQ’

ocean

shapeis the ocean surface geometry.

style type describe default value
watercolor IColor water color #6D99A8
watercolor2 IColor water color #0F121C

other

Others supported by geometry layersshapeThere are corresponding layers. You can refer to the style parameters of the corresponding layers.

© Copyright 2026 Ant Group Co., Ltd..备案号:京ICP备15032932号-38
Site search
Documentation and examplesType to start searching

Search documentation, APIs, and examples

↑↓Select↵OpenEscClose