VoxelLayer and time

This sample shows how to access the temporal data of a VoxelLayer and use it with the TimeSlider.

A VoxelVariable has one of the following volumeType xyz, xyzt or xyt. The x, y and z represent a geographic coordinate and t represents time. A volumeType of xyzt adds time as the fourth dimension and makes the VoxelLayer a time-aware layer. The volumeType xyt is not a time-aware layer. The time is represented along the z dimension. The stops in the timeInfo returns the time instants the VoxelLayer has data for.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
const vxlVolume = vxlLayer.getVolume(null);
const vxlVolumeType = vxlVolume.volumeType;
// Check that the volume type is xyzt
if (vxlVolumeType === "xyzt") {
    // Configure the timeSlider to use the layer's timeInfo.stops
    timeSlider.fullTimeExtent = vxlLayer.timeInfo.fullTimeExtent;
    timeSlider.stops = {
        dates: vxlLayer.timeInfo.stops
    };
    timeSlider.mode = "instant"; // The slider will show temporal data that falls on a single instance in time.
}

In this sample, you can see overtime the underground soil contamination from chlorinated solvents with a value of 1000 µg/l in The Hague.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.