Open m-mohr opened 1 year ago
For 3D STAC producers/consumers, it could also make sense to implement support for
Edit:
Example for potree to represent potree or copc tilesets can be based on Darren Wiens potree viewer implementation, which takes dataset url as urlParam:
// color type can be among rgba, elevation, color, elevation, etc
// potree_cloud_js_url = https://potree.org/potree/pointclouds/vol_total/cloud.js
potree_darren_wiens_url = `https://mpc-copc-viewer.netlify.app/?r=${potree_cloud_js_url}&c=rgba`
Example for cesium to represent OGC 3D-Tiles, via the Cesium Sandcastle:
tileset_url = 'tileset_url'
code_payload = {
html: `
<style> @import url(../templates/bucket.css); </style>
<div id="cesiumContainer" class="fullSize"></div>
`,
code: `
const viewer = new Cesium.Viewer("cesiumContainer", {
terrain: Cesium.Terrain.fromWorldTerrain(),
});
try {
const tileset = await Cesium.Cesium3DTileset.fromUrl(${tileset_url});
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset);
} catch (error) {
console.log('Error loading tileset');
}
`
}
code_str = window.btoa(JSON.stringify(code_payload))
cesium_sandcastle_url = `https://sandcastle.cesium.com/index.html?code=${code_str}`
Example for single static meshes based on open-source 3dviewer, works for gltf/glb, obj, ply, fbx etc
3dviewer_url = `https://3dviewer.net/#model=${modelUrl}`
Other cited data formats in the original issue thread, see here
PRs are more than welcome :-)
Has it been already discussed a way to embed these viewers as iframes within stac-browser? Would that be too ugly to add these as a third tab (replacing Map/Thumbnail component)?
Not yet. I'm a bit sceptical about iframes, but I could also see a modular approach to actually embedding e.g. Cesium (maybe via ol-cesium as migrating to ol would anyway be on the roadmap), directly.
Proposals for more actions (see #342):