TimeSlider in a React app with local client-side data

154
0
02-20-2024 02:09 PM
sim-cropsy
New Contributor

Hi, I'm using "@arcgis/core": "^4.28.10" in a React app. All the feature layers and graphics are created using client-side data. There is no "url" provided anywhere to create layers or graphics.

Now I am trying to create a TimeSlider.
My data looks like this

const data = [
{
id: 1,
coordinates: [173.788690644, -41.49193959],
StartTime: new Date(2000, 0, 1),
EndTime: new Date(2001, 0, 2),
},
{
id: 2,
coordinates: [173.788690644 + 0.005, -41.49193959 + 0.005],
StartTime: new Date(2001, 0, 3),
EndTime: new Date(2002, 0, 4),
},
{
id: 3,
coordinates: [173.788690644 + 0.001, -41.49193959 + 0.001],
StartTime: new Date(2002, 0, 5),
EndTime: new Date(2003, 0, 6),
},]


How can I use this data to create a feature layer which respects the time slider and updates the graphics on the map accordingly? Please help.
Thank you.

0 Kudos
0 Replies