如何在 kepler.gl 中请求渲染新帧?
我创建了一个动画的 deck.gl 图层,就像 vis.academy 教程中的那个:http: //vis.academy/#/custom-layers/5-custom-uniform
我还成功地将该层与 kepler.gl 集成。
但是,仅当我移动鼠标或视口时,kepler.gl 才会更新图层(渲染新帧)。
在deckl.gl中,新帧的请求是在应用程序的初始化中配置的:
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
viewport: {
width: window.innerWidth,
height: window.innerHeight,
longitude: -74,
latitude: 40.7,
zoom: 11,
pitch: 30,
maxZoom: 16
}
};
this._resize = this._resize.bind(this);
this._animate = this._animate.bind(this);
this._onViewportChange = this._onViewportChange.bind(this);
}
……
_animate() {
this.setState({});
this._animation = window.requestAnimationFrame(this._animate);
}
但是,到目前为止,我无法在 kepler.gl 中找出相应的操作。