return (
<Viewer
full
ref={e => {
viewer = e && e.cesiumElement;
}}>
</Viewer>
);
}
export default App;
This is the example code provided in the official documentation for importing 3D Tiles data, but I am unable to run it. I uploaded my own 3D Tiles data to Cesium, with an ID of 2751705. I can confirm the data is correct because I can see the building data loaded successfully through Cesium's preview. I can also ensure that my framework has imported all the necessary libraries correctly, as other official code works perfectly. I am using the REACT + VITE + JavaScript framework.
import { Viewer, Cesium3DTileset } from "resium"; import { IonResource } from "cesium";
function App() { let viewer; // This will be raw Cesium's Viewer object.
const handleReady = tileset => { if (viewer) { viewer.zoomTo(tileset); } };
return ( <Viewer full ref={e => { viewer = e && e.cesiumElement; }}>
); }
export default App; This is the example code provided in the official documentation for importing 3D Tiles data, but I am unable to run it. I uploaded my own 3D Tiles data to Cesium, with an ID of 2751705. I can confirm the data is correct because I can see the building data loaded successfully through Cesium's preview. I can also ensure that my framework has imported all the necessary libraries correctly, as other official code works perfectly. I am using the REACT + VITE + JavaScript framework.