我在kepler.gl 工作并从数据库中加载数据。如果数据库更新,我希望能够动态更新数据集。有没有办法向数据集添加一行并更新地图?
我尝试删除数据集(使用 removeDataset)并将其与更新的数据(addDataToMap)一起重新添加,但是对于较大的数据集,这效率不高。
提前致谢。
我在kepler.gl 工作并从数据库中加载数据。如果数据库更新,我希望能够动态更新数据集。有没有办法向数据集添加一行并更新地图?
我尝试删除数据集(使用 removeDataset)并将其与更新的数据(addDataToMap)一起重新添加,但是对于较大的数据集,这效率不高。
提前致谢。
thank you for using Kepler.gl. I work in in the team who built Kepler.
Currently we don't have a straight way to update an existing dataset. There is an existing issue on our github project: https://github.com/uber/kepler.gl/issues/176.
In the meanwhile, you can change your flow by skipping removeDataSet and call addDataToMap with your new data. Make sure the new dataset id that you are passing as addDataToMap call matches the existing one; by doing so you are going to override existing data with your new data.
Make sure you pass the same configuration that is currently in your kepler state as part of your addDataToMap call.
You can use KeplerGlSchema to export the configuration before you call addDataToMap