Style
styleThe method is used to configure the style of the layer. The same layer has differentshapegraphics, differentshapelayerstyleMethods accept different parameters.
🌟 Honeycomb heat map and grid heat mapstyleThe style can refer to the actual drawn layer.
layer.style({
opacity: 0.5,
});
common
UniversalstyleParameters, parameters supported by all graphics.
| style | type | describe | default value |
|---|---|---|---|
| opacity | number |
Graphic transparency | 1 |
heatmap
shapeforheatmap、heatmap3Dtype, draw a classic heat map.
| style | type | describe | default value |
|---|---|---|---|
| intensity | number |
intensity of heat | 10 |
| radius | number |
The radius of the hot spot | 10 |
| rampColors | number |
thermal color value | 1 |
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],
},
});
hexagon
Draw cellular heat maps.
| style | type | describe | default value |
|---|---|---|---|
| angle | number |
Graphic rotation angle | 0 |
| coverage | number |
graphics coverage ratio | 0.9 |
grid
Draw a grid heat map.
| style | type | describe | default value |
|---|---|---|---|
| coverage | number |
graphics coverage ratio | 1 |