2020-01-07 21:15:23 +08:00
|
|
|
|
---
|
|
|
|
|
title: 栅格图层
|
|
|
|
|
order: 5
|
|
|
|
|
---
|
|
|
|
|
|
2020-01-08 00:17:58 +08:00
|
|
|
|
Raster 图层主要实现栅格数据的可视化,栅格数据主要来源是卫星遥感数据,如数字高程图,植被分布图,夜光图。
|
|
|
|
|
|
|
|
|
|
L7 本身内部没有提供栅格数据格式 如 tiff,需要外部解析好做为 Source 传入。
|
2020-01-07 21:15:23 +08:00
|
|
|
|
|
|
|
|
|
## 使用
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
import { RasterLayer } from '@antv/l7';
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## source
|
|
|
|
|
|
2020-01-08 00:17:58 +08:00
|
|
|
|
见 [raster source](../source/raster)
|
2020-01-07 21:15:23 +08:00
|
|
|
|
|
|
|
|
|
## shape
|
|
|
|
|
|
2020-01-08 00:17:58 +08:00
|
|
|
|
`raster`
|
2020-01-07 21:15:23 +08:00
|
|
|
|
|
|
|
|
|
## size
|
2020-01-08 00:17:58 +08:00
|
|
|
|
|
2020-01-07 21:15:23 +08:00
|
|
|
|
无
|
2020-01-08 00:17:58 +08:00
|
|
|
|
|
2020-01-07 21:15:23 +08:00
|
|
|
|
## color
|
2020-01-08 00:17:58 +08:00
|
|
|
|
|
2020-01-07 21:15:23 +08:00
|
|
|
|
无
|
2020-01-08 00:17:58 +08:00
|
|
|
|
|
2020-01-07 21:15:23 +08:00
|
|
|
|
## style
|
2020-01-08 00:17:58 +08:00
|
|
|
|
|
|
|
|
|
- clampLow Boolean 默认 false, 设置为 true,低于 domain 的数据将不显示
|
|
|
|
|
- clampHigh Boolean 默认 false, 设置为 true,高于 domain 的数据将不显示
|
2020-01-07 21:15:23 +08:00
|
|
|
|
- opacity: 0.8 Number 透明度
|
2020-01-08 00:17:58 +08:00
|
|
|
|
- domain: [ 0, 8000 ] 数据映射区间
|
2020-01-07 21:15:23 +08:00
|
|
|
|
- noDataValue Number noDataValue 不会显示
|
|
|
|
|
- rampColors: {
|
2020-01-30 23:43:27 +08:00
|
|
|
|
colors: [ '#FF4818', '#F7B74A', '#FFF598', '#91EABC', '#2EA9A1', '#206C7C' ],
|
2020-01-08 00:17:58 +08:00
|
|
|
|
positions: [ 0, 0.2, 0.4, 0.6, 0.8, 1.0 ]
|
|
|
|
|
} // 色带
|
2020-01-07 21:15:23 +08:00
|
|
|
|
|
2020-01-30 23:43:27 +08:00
|
|
|
|
⚠️ color, position 的长度要相同
|