2020-08-10 10:44:28 +08:00
|
|
|
|
---
|
|
|
|
|
title: 填充图
|
|
|
|
|
order: 1
|
|
|
|
|
---
|
2021-12-29 17:08:46 +08:00
|
|
|
|
|
2020-11-21 03:51:18 +08:00
|
|
|
|
`markdown:docs/common/style.md`
|
2020-08-20 17:09:45 +08:00
|
|
|
|
|
2020-08-10 10:44:28 +08:00
|
|
|
|
## 使用
|
2020-08-20 17:09:45 +08:00
|
|
|
|
|
2020-08-10 10:44:28 +08:00
|
|
|
|
```javascript
|
2020-08-20 17:09:45 +08:00
|
|
|
|
import { PolygonLayer } from '@antv/l7';
|
2020-08-10 10:44:28 +08:00
|
|
|
|
const layer = new PolygonLayer();
|
|
|
|
|
```
|
2020-08-20 17:09:45 +08:00
|
|
|
|
|
2020-08-10 10:44:28 +08:00
|
|
|
|
### shape
|
2020-08-20 17:09:45 +08:00
|
|
|
|
|
|
|
|
|
绘制填充图,shape 为`fill` 常量不支持数据映射
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
layer.shape('fill');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### size
|
2020-08-20 17:09:45 +08:00
|
|
|
|
|
|
|
|
|
填充图无 size 不需要设置 size
|
|
|
|
|
|
2021-12-06 17:06:44 +08:00
|
|
|
|
## 额外的 style 配置
|
|
|
|
|
|
|
|
|
|
- opacityLinear 设置几何填充图的径向渐变
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
style({
|
|
|
|
|
opacityLinear: {
|
|
|
|
|
enable: true, // true - false
|
2021-12-29 17:08:46 +08:00
|
|
|
|
dir: 'in', // in - out
|
|
|
|
|
},
|
|
|
|
|
});
|
2021-12-06 17:06:44 +08:00
|
|
|
|
```
|
2021-12-29 17:08:46 +08:00
|
|
|
|
|
2021-12-29 17:05:50 +08:00
|
|
|
|
[径向渐变 in](../../../examples/polygon/fill#china_linear_in)
|
|
|
|
|
[径向渐变 out](../../../examples/polygon/fill#china_linear_out)
|
2021-12-06 17:06:44 +08:00
|
|
|
|
|
2020-11-16 15:19:41 +08:00
|
|
|
|
`markdown:docs/common/layer/base.md`
|