diff --git a/web/maplibre-demo.js b/web/maplibre-demo.js index da84e45..6b33834 100644 --- a/web/maplibre-demo.js +++ b/web/maplibre-demo.js @@ -140,7 +140,7 @@ function is3DAsset(asset) { if (!asset) return false; const kind = String(asset.kind || "").toLowerCase(); const ext = normalizeExt(asset.ext) || extFromLink(asset.link); - return kind === "3d" && (ext === "glb" || ext === "gltf"); + return kind === "3d" && ext === "glb"; } async function renderSharedAssetFromQuery() { @@ -344,6 +344,12 @@ async function addObjectMeshFromAsset(featureId, lng, lat, asset, cycleID) { } if (!is3DAsset(asset) || !asset.link) { + const ext = normalizeExt(asset.ext) || extFromLink(asset.link); + if (String(asset.kind || "").toLowerCase() === "3d" && ext === "gltf") { + console.warn( + `Feature ${featureId} uses .gltf. Map rendering supports self-contained .glb via /download; using fallback shape.` + ); + } addFallbackMesh(featureId, lng, lat, Boolean(asset.isPublic), asset.kind || "3d"); return false; } @@ -542,6 +548,9 @@ async function createFeatureAndUpload() { if (!ext) { throw new Error("File extension is required."); } + if (ext === "gltf") { + setStatus("Note: .gltf may fail on map if it references external files. Prefer .glb for reliable 3D rendering."); + } await ensureCollection(); const featureName = assetNameEl.value.trim() || file.name;