Skip to content

Commit 62ddd7d

Browse files
committed
Merge ochafik/post-fixes
2 parents 1ddfe41 + 8b7f5c3 commit 62ddd7d

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

examples/basic-host/src/sandbox.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,17 @@ window.addEventListener("message", async (event) => {
9595
inner.setAttribute("allow", allowAttribute);
9696
}
9797
if (typeof html === "string") {
98-
inner.srcdoc = html;
99-
} else {
100-
console.error("[Sandbox] Missing or invalid HTML content in sandbox-resource-ready notification.");
98+
// Use document.write instead of srcdoc (which the CesiumJS Map won't work with)
99+
const doc = inner.contentDocument || inner.contentWindow?.document;
100+
if (doc) {
101+
doc.open();
102+
doc.write(html);
103+
doc.close();
104+
} else {
105+
// Fallback to srcdoc if document is not accessible
106+
console.warn("[Sandbox] document.write not available, falling back to srcdoc");
107+
inner.srcdoc = html;
108+
}
101109
}
102110
} else {
103111
if (inner && inner.contentWindow) {

examples/map-server/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async function geocodeWithNominatim(query: string): Promise<NominatimResult[]> {
8989
*/
9090
export function createServer(): McpServer {
9191
const server = new McpServer({
92-
name: "CesiumJS Map Server",
92+
name: "Map Server",
9393
version: "1.0.0",
9494
});
9595

0 commit comments

Comments
 (0)