I have a GeoJSONLayer which I am creating on the client, as a result of data from a webservice at my backend. I am using this layer to create a heatmap, which I am binding to a TimeSlider, so that I can see the heatmap over time.
The user can change the time frame from which the GeoJSONLayer is created, for example, go from one day to two days. When this happens, I get data from my backend for the new time frame. I re-create the GoeJSONLayer and destroy and recreate the TimeSlider, as it's fullTimeExtent has completely changed. Essentially a complete reset.
But, what is happening is that the TimeSlider is removed from the UI when I reset, and I can't get it back. What is the prefered method of updating the data/layer that the TimeSlider is bound to, so that it can cope with the data changing and start over?
Here is the workflow I am using:
Get data from server -> create TimeSlider, supplying existing html container -> create GeoJSONLayer from the data returned from the server -> create heatmap from GeoJSONLayer using HeatMapRenderer -> wait for heatmap to be added to the view -> set TimeSlider fullTimeExtent and timeExtent -> watch timeExtent and filter heatmap layer using definitionExpression -> play TimeSlider.
When I do that the second time, the heatmap is displayed and even plays, but the TimeSlider is not on the UI.