Skip to content

Style

of tile layerstyleParameters depend on the layer used. Such as vector point layer,styleThe parameters of are the parameters of the corresponding point layer.

raster tile

domain: [number, number]

Set the domain of data mapping.
ps: The fixed value range is[0, 1], we map the incoming value (domain) to the value domain[0, 1]Later fromrampColorThe built ribbon picks up colors, and RGB multi-channel rasters are not supported.

clampLow/clampHigh: boolean

clampLowThe default value isfalse,Set astrue, lower thandomainThe data will not be displayed.
clampHighThe default value isfalse,Set astrue, higher thandomainThe data will not be displayed.

ps: rgb multi-channel raster is not supported

rampColors

  • colors color array
  • positions data interval

Configure the color band of the value range mapping color. The range of the value range is[0 - 1], correspondingly we need to provide eachpositionPosition sets a color value.

⚠️ colors, positions must be the same length

layer.style({
  rampColors: {
    colors: ['#FF4818', '#F7B74A', '#FFF598', '#91EABC', '#2EA9A1', '#206C7C'],
    positions: [0, 0.2, 0.4, 0.6, 0.8, 1.0],
  },
});

ps: ⚠️ The lengths of color and position must be the same, rgb multi-channel raster is not supported

vector tile

of vector layersstyleThe style remains the same as the normal layer.

event

🌟 Data raster supports layer events, while image raster currently does not support layer events.

Binding events

🌟 Data grid tiles

// The method of binding events is consistent with that of ordinary layers.
layer.on('click', e => {...})

event parameters

🌟 Data grid tiles The event parameters of data grid tiles return new parameters compared to the events of ordinary layers.

value: number

🌟 Data grid tiles The actual value of the tile at the mouse event location.

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

Search documentation, APIs, and examples

↑↓Select↵OpenEscClose