This is the documentation of version 0.49.0. Go to the latest version, 1.0.0.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias ToolState

    State passed to tool factory functions. Organized by feature area, each sub-state mixes lazy module access with the current service data produced during the session.

    function createMyTool(state: ToolState) {
    return tool({
    execute: async () => {
    const pins = await state.places.getPinPlacesModule();
    state.routing.currentRoutes; // most recent routes
    state.baseMap.mapLibreMap; // MapLibre instance
    }
    });
    }
    type ToolState = {
        analyses: Analyses;
        baseMap: BaseMapState;
        byod: BYODState;
        codeExecution: SandboxExecutor;
        customGeometries: CustomGeometriesState;
        mapPOIs: MapPOIsState;
        places: PlacesState;
        ranges: RangeState;
        routing: RoutingState;
        trackers: TrackerState;
        trafficAreaAnalytics: TrafficAreaAnalyticsState;
        trafficIncidents: TrafficIncidentsState;
        trafficTiles: TrafficTilesState;
    }
    Index

    Properties

    analyses: Analyses

    Single session-level registry of every analysis (one-shot + recurring) across all entry kinds. Replaces the old per-entry _analyses stores: results live here, and per-entry views read them on demand via Analyses.getAnalysesForEntry. analyseData registers; monitorAnalysis toggles enabled.

    baseMap: BaseMapState

    Base map display: style, language, viewport, layers, and hillshade.

    byod: BYODState

    Bring-your-own-data GeoJSON layers — customer-authored data the agent can read and render.

    codeExecution: SandboxExecutor

    Strategy used to run code-generation tools (analyseData / processData). Initialised to the main-thread executor by createToolState, and overridden by createMapAgent from MapAgentOptions.codeExecution. Tools read this to select where sandbox code runs.

    customGeometries: CustomGeometriesState

    Derived/custom polygon entries — output of processData.

    mapPOIs: MapPOIsState

    Map POI layer: visibility, filtering, and category management.

    places: PlacesState

    Places layer: PlacesModule plus an append-only search history.

    ranges: RangeState

    Reachable range results: origin, budgets, and bbox summaries.

    routing: RoutingState

    Route calculation, waypoint management, and planning parameter state.

    trackers: TrackerState

    Generic trackers — thin rising-edge reducers over type: 'tracker-rule' analyses. A tracker fires an alert/event when its rule's Verdict crosses an edge. Reacts to analysis-change; owns the durable TrackerEvent log.

    trafficAreaAnalytics: TrafficAreaAnalyticsState

    Traffic area analytics: aggregation module + last result + viz config.

    trafficIncidents: TrafficIncidentsState

    Traffic incidents: fetched entry history and per-entry rendering.

    trafficTiles: TrafficTilesState

    Traffic tile overlays: flow tiles + incident overlay tiles.