Skip to main content

Filtering

MapWeave can handle up to 1 million data points while retaining real-time performance. However, in order to extract specific narratives it can be helpful to filter the data, by time, location and more.

Filtering by Time

MapWeave provides a simple timeFilterRange API to only display items within a specific time period for both the network and observations layers.

Useful APIs:

NetworkLayerOptions timeFilterRange | ObservationsLayerOptions timeFilterRange

Here you can see the path of Hurricane Rafael in November 2024. A simple html input is used with MapWeave to control the timeFilterRange in the observations layer, use the slider to filter the observations to the dates shown.

A code snippet is shown below, or log in to open the example in the playground to see the full code.


// set values for the initial start and end date for the filter
let dt1 = new Date('2024-11-03T18:00:00.000Z');
let dt2 = new Date('2024-11-10T12:00:00.000Z');

// set those date values in the time filter range in the observations options object
const observationsOptions = {
timeFilterRange: { start: dt1, end: dt2 },
};

// create a new observations layer
const observationsLayer = new ObservationsLayer({
data: myData,
options: observationsOptions,
});

// add the observations layer to MapWeave
mapweave.addLayer(observationsLayer);

MapWeave can also be integrated with the Keylines Time Bar or KronoGraph for more complex filtering.