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