TomTom Maps for JavaScript
    Preparing search index...

    Type Alias BaseDataset<Data, ProducedFrom>

    BaseDataset: { data: Data; id: string; label: string; timestamp: number } & (
        undefined extends ProducedFrom
            ? { producedFrom?: ProducedFrom }
            : { producedFrom: ProducedFrom }
    )

    The fields every dataset shares across the toolkit's state slices: identity (id), when and what it is (timestamp, label), the slice's payload (data) and what produced it (producedFrom). A slice keeps anything else it needs per dataset, and what the map shows, on itself rather than on the dataset.

    Type Parameters

    • Data extends FeatureCollection$1 = FeatureCollection$1

      The dataset's payload, a GeoJSON FeatureCollection such as Routes, Places or TrafficIncidentDetails. It is the single result the dataset was created to hold.

    • ProducedFrom = undefined

      What produced this dataset. The shape differs by slice, because each slice is produced from different inputs: a route from its waypoints and parameters, incidents from the query a monitor replays, a derived geometry from the operation and its sources, bring-your-own-data from where the GeoJSON came from. Recall reports it, and a monitor replays it. Leave it out for a slice that records none, such as places and ranges, which makes producedFrom absent.

    Type Declaration

    • data: Data

      The dataset's payload, the single result it was created to hold.

    • id: string

      The stable, slice-unique dataset id, such as places-0 or a caller-supplied id deduped against existing datasets on collision. Tools and recall surfaces address the dataset by it.

    • label: string

      A short, human-readable label, shown in recall and recents surfaces.

    • timestamp: number

      The creation or last-refresh time, in milliseconds since the epoch. It is set when the dataset is added and bumped on each in-place replace. A monitored re-run stamps the source sample time.