I am working with data that I need to retrieve from a REST API (providing the start and end timestamps of the data I am requesting) and display in Cesium. The way I had built this was to create a CustomDataSource. In my data source’s update function, I check the time. If it exceeds a threshold close to the end of the previously retrieved data, it requests new data for the next x seconds.
The problem with this (as far as I can tell), is that the data is never released. The custom data source’s entity collection will simply continue to grow as more data is added. (Including both new entities and data samples for existing entities)
Is this the right approach? Whenever I request new data, I can clear out the existing entities, but I don’t really want to do that in case the user was tracking an entity with the camera. I could clear out the entity’s data structure, but leave its id and name, but this seems to crash Cesium. Am I making this out to be a bigger problem? Can Cesium somehow handle this internally?