feat: 补充 3D 柱图的 demo 和相关文档

This commit is contained in:
shihui 2021-12-23 14:01:44 +08:00
parent f32c721c1b
commit 725d2f8fa2
6 changed files with 25 additions and 4 deletions

View File

@ -58,7 +58,23 @@ const column = new PointLayer({})
opacity: 1.0,
});
```
### animate
3D 柱图支持生长动画
animate 方法支持的布尔值和对象参数
```javascript
animate(true)
animate(false)
animate(animateOptions)
animateOptions: {
enable: boolean;
speed?: number = 0.01;
repeat?: number = 1;
}
```
## 额外的 style 配置
- sourceColor 设置 3D 柱图起始颜色3D 柱图设置颜色渐变时会覆盖 color 设置的颜色)

View File

@ -24,8 +24,9 @@ scene.on('loaded', () => {
})
.shape('cylinder')
.size('t', function(level) {
return [ 1, 2, level * 2 + 20 ];
return [ 2, 2, level * 2 + 20 ];
})
.animate(true)
.active(true)
.color('t', [
'#094D4A',

View File

@ -8,7 +8,7 @@ const scene = new Scene({
style: 'dark',
center: [ 121.400257, 31.25287 ],
zoom: 14.55,
rotation: 134.9507
rotation: 134.95
})
});
scene.on('loaded', () => {
@ -25,6 +25,7 @@ scene.on('loaded', () => {
y: 'latitude'
}
})
.animate(true)
.active(true)
.shape('name', [
'cylinder',

View File

@ -31,6 +31,7 @@ scene.on('loaded', () => {
'hexagonColumn',
'squareColumn'
])
.animate(true)
.active(true)
.size('unit_price', h => {
return [ 6, 6, h / 500 ];

View File

@ -4,7 +4,7 @@ import { GaodeMap } from '@antv/l7-maps';
const scene = new Scene({
id: 'map',
map: new GaodeMap({
pitch: 35.210526315789465,
pitch: 40,
style: 'dark',
center: [ 104.288144, 31.239692 ],
zoom: 4.4
@ -24,8 +24,9 @@ scene.on('loaded', () => {
})
.shape('cylinder')
.size('t', function(level) {
return [ 1, 2, level * 2 + 20 ];
return [ 2, 2, level * 2 + 20 ];
})
.animate(true)
.active(true)
.color('t', [
'#094D4A',

View File

@ -27,6 +27,7 @@ scene.on('loaded', () => {
.size('t', function(level) {
return [ 1, 1, level * 2 + 20 ];
})
.animate(true)
.active(true)
.color('#006CFF')
.style({