[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3DTileset not receiving any url #138

Closed
nadavtal opened this issue Dec 3, 2019 · 11 comments
Closed

3DTileset not receiving any url #138

nadavtal opened this issue Dec 3, 2019 · 11 comments
Labels

Comments

@nadavtal
Copy link
nadavtal commented Dec 3, 2019

Hello, i'm trying desperatley to insert a tileset in my 3dTileset component. how ever the "url" property is not working and not showing anything, also if i put an invalid address in it it doesnt show an error.
been trying for 2 days now with webpack without success.
any help?

@rot1024
Copy link
Member
rot1024 commented Dec 3, 2019

It may be a problem of Cesium or webpack, not Resium. You can try with raw Cesium3DTileset of Cesium.

import React, { useRef, useEffect } from "react";
import { Viewer, Cesium3DTileset } from "cesium"; 

const Test = () => {
  const ref = useRef();
  useEffect(() => {
    if (!ref.current) return;
    const viewer = new Viewer(ref.current);
    viewer.scene.primitives.add(new Cesium3DTileset({
      url: "YOUR URL"
    }));
  }, []);
  return <div ref={ref} style={{ width: "300px", height: "300px" }} />
}

@nadavtal
Copy link
Author
nadavtal commented Dec 3, 2019

Thank you very much. i still get the same result. the viewer is loading but not the 3d tileset. and no errors. i think too that it either a problem with cesium or webpack.
is there any way to get help to solve the problem? paid ofcourse. i;'m buidling a big app based on resium.
thanks alot:)

@rot1024
Copy link
Member
rot1024 commented Dec 3, 2019

You can use onTileLoad, onTileFailed, onReady event props to debug whether loading is done or failed.

const Test = () => {
  const ref = useRef(null);
  return <Viewer>
      <Cesium3DTileset
        url="hogehoge/tileset.json"
        onAllTilesLoad={(...args) => console.log("onAllTilesLoad", ...args)}
        onInitialTilesLoad={(...args) => console.log("onInitialTilesLoad", ...args)}
        onTileFailed={(...args) => console.log("onTileFailed", ...args)}
        onTileLoad={(...args) => console.log("onTileLoad", ...args)}
        onTileUnload={(...args) => console.log("onTileUnload", ...args)}
        onReady={tileset => {
          console.log("onReady", tileset);
          ref.current.cesiumElement.zoomTo(tileset);
        }}
      />
  </Viewer>;
}

@nadavtal
Copy link
Author
nadavtal commented Dec 3, 2019

Further more, i see in the example
https://resium.darwineducation.com/examples/?path=/story/cesium3dtileset--basic
that the tileset is not shown. perhaps it's the same issue?

@nadavtal
Copy link
Author
nadavtal commented Dec 3, 2019

i have tried all of them and none of the are fired. i thought it's becuase its not getting anything in the url field therefore they are not firing

@rot1024
Copy link
Member
rot1024 commented Dec 3, 2019

Further more, i see in the example
https://resium.darwineducation.com/examples/?path=/story/cesium3dtileset--basic
that the tileset is not shown. perhaps it's the same issue?

It is because the json file of url is 404 not found. I'll fix it soon.

Tileset data is here: https://github.com/darwin-education/resium/tree/master/.storybook/public/tileset

@nadavtal
Copy link
Author
nadavtal commented Dec 3, 2019

yes. i dont get the "Failed to load resource" if i put a wrong address in the url. i dont get anythink. hence the frustration:)

@nadavtal
Copy link
Author
nadavtal commented Dec 3, 2019

are you or do you know any experienced developers with resium than can help me when needed in my project? paid ofcoarse. i'm building a big project based on Cesium and Resium:)

@gavinhon
Copy link

@nadavtal you could try placing your 3dtiles under the 'public' folder. it works for me.

@rot1024
Copy link
Member
rot1024 commented Feb 17, 2020

If the issue persists, please reopen the issue.

@rot1024 rot1024 closed this as completed Feb 17, 2020
@telmomm
Copy link
telmomm commented Sep 20, 2023

The issue persist for me (TypeError: undefined is not an object (evaluating 'this._url = undefined')) with version 1.17.1, I try to put the json file in different locations and have the same problem (also with web json hosted files)
Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants