This is the documentation of version 1.0.0-rc.4. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Variable createExecuteMaplibreCodeToolConst

    createExecuteMaplibreCodeTool: () => ToolEntry

    Builds the executeMaplibreCode ToolEntry, which runs model-written JavaScript in your page against the live MapLibre map, with no sandbox. It is not in DEFAULT_TOOLS: add it through createMapAgent's tools option only where you trust the model and every prompt and tool result it reads.

    createMapAgent(map, {
    model,
    tools: { executeMaplibreCode: createExecuteMaplibreCodeTool() },
    });

    Type Declaration