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-10 10:44:28 +08:00
|
|
|
|
用一组首尾不闭合的点坐标对来定位的线图层,通常用来表示轨迹,线路,道路等
|
|
|
|
|
|
|
|
|
|
## 使用
|
|
|
|
|
|
2022-01-06 16:29:28 +08:00
|
|
|
|
```javascript
|
|
|
|
|
import { LineLayer } from '@antv/l7';
|
|
|
|
|
```
|
|
|
|
|
|
2022-01-17 20:39:01 +08:00
|
|
|
|
<img width="60%" style="display: block;margin: 0 auto;" alt="案例" src='https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*KEupSZ_p0pYAAAAAAAAAAAAAARQnAQ'>
|
2022-01-06 16:29:28 +08:00
|
|
|
|
|
|
|
|
|
[在线案例](../../../examples/gallery/animate#animate_path)
|
|
|
|
|
|
2020-08-10 10:44:28 +08:00
|
|
|
|
### shape
|
2020-08-20 17:09:45 +08:00
|
|
|
|
|
|
|
|
|
shape 设置成 line 即可绘制路线图
|
|
|
|
|
|
|
|
|
|
- line
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
|
|
|
|
### size
|
2020-08-20 17:09:45 +08:00
|
|
|
|
|
|
|
|
|
路径图线的 size 支持两个维度
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
|
|
|
|
- width 宽度
|
|
|
|
|
- height 高度
|
|
|
|
|
|
|
|
|
|
```javascript
|
2020-08-20 17:09:45 +08:00
|
|
|
|
layer.size([2, 10]); // 绘制宽度为2,高度为10的路径
|
|
|
|
|
|
|
|
|
|
layer.size('height', []);
|
2020-08-10 10:44:28 +08:00
|
|
|
|
```
|
2020-08-20 17:09:45 +08:00
|
|
|
|
|
2022-01-06 16:59:54 +08:00
|
|
|
|
🌟 通过设置第二个参数我们可以得到等高线图
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
2022-01-06 16:57:38 +08:00
|
|
|
|
<img width="450px" style="display: block;margin: 0 auto;" alt="案例" src='https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*p6LsTp3M144AAAAAAAAAAABkARQnAQ'>
|
|
|
|
|
|
|
|
|
|
[在线案例](../../../examples/line/isoline#ele)
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
2022-01-06 16:59:54 +08:00
|
|
|
|
✨ 当用户在传入数据的第三个值可以用于表示当前点的高度,通过在 source 中传入的第三个参数我们可以的高度不等的线图层
|
2022-01-06 16:57:38 +08:00
|
|
|
|
|
|
|
|
|
`markdown:docs/api/line_layer/features/vertexHeight.zh.md`
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
2022-01-06 16:29:28 +08:00
|
|
|
|
`markdown:docs/api/line_layer/features/linear.zh.md`
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
2022-01-06 19:48:35 +08:00
|
|
|
|
`markdown:docs/api/line_layer/features/border.zh.md`
|
|
|
|
|
|
2022-01-06 16:29:28 +08:00
|
|
|
|
`markdown:docs/api/line_layer/features/animate.zh.md`
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
2022-01-06 16:29:28 +08:00
|
|
|
|
`markdown:docs/api/line_layer/features/texture.zh.md`
|
2020-08-10 10:44:28 +08:00
|
|
|
|
|
2020-11-16 15:19:41 +08:00
|
|
|
|
`markdown:docs/common/layer/base.md`
|