From 8b7f5c3b497d0b62bcdf0692d1b392bd1aea3196 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Tue, 13 Jan 2026 01:22:06 +0000 Subject: [PATCH 1/2] revert to document.write again; cesiumjs doesn't like srcdoc, period. --- examples/basic-host/src/sandbox.ts | 14 +++++++++++--- examples/map-server/server.ts | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/examples/basic-host/src/sandbox.ts b/examples/basic-host/src/sandbox.ts index 6eb758a0..d4a4e577 100644 --- a/examples/basic-host/src/sandbox.ts +++ b/examples/basic-host/src/sandbox.ts @@ -95,9 +95,17 @@ window.addEventListener("message", async (event) => { inner.setAttribute("allow", allowAttribute); } if (typeof html === "string") { - inner.srcdoc = html; - } else { - console.error("[Sandbox] Missing or invalid HTML content in sandbox-resource-ready notification."); + // Use document.write instead of srcdoc (which the CesiumJS Map won't work with) + const doc = inner.contentDocument || inner.contentWindow?.document; + if (doc) { + doc.open(); + doc.write(html); + doc.close(); + } else { + // Fallback to srcdoc if document is not accessible + console.warn("[Sandbox] document.write not available, falling back to srcdoc"); + inner.srcdoc = html; + } } } else { if (inner && inner.contentWindow) { diff --git a/examples/map-server/server.ts b/examples/map-server/server.ts index b36db931..dd0a0c04 100644 --- a/examples/map-server/server.ts +++ b/examples/map-server/server.ts @@ -89,7 +89,7 @@ async function geocodeWithNominatim(query: string): Promise { */ export function createServer(): McpServer { const server = new McpServer({ - name: "CesiumJS Map Server", + name: "Map Server", version: "1.0.0", }); From 1f9d071bfef74b9e69944504660a19b3454ec2cd Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Tue, 13 Jan 2026 02:15:41 +0000 Subject: [PATCH 2/2] Update server.ts --- examples/map-server/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/map-server/server.ts b/examples/map-server/server.ts index dd0a0c04..b36db931 100644 --- a/examples/map-server/server.ts +++ b/examples/map-server/server.ts @@ -89,7 +89,7 @@ async function geocodeWithNominatim(query: string): Promise { */ export function createServer(): McpServer { const server = new McpServer({ - name: "Map Server", + name: "CesiumJS Map Server", version: "1.0.0", });