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

Nothing was returned from render when trying to use any graphics wrapped in an Entity #438

Closed
jabusir opened this issue Sep 29, 2020 · 7 comments
Labels

Comments

@jabusir
Copy link

jabusir commented Sep 29, 2020

When I pass "point" to Entity, I can get a circular point rendering on the globe as expected, but as soon as I wrap any Graphic component with Entity, the app crashes with this error:

image

All the code is on the same level, and there isn't any custom data.

import React, { useState, useEffect } from "react";
import { hot } from "react-hot-loader/root";
import { Cartesian3, Color } from "cesium";
import { Viewer, Entity, BoxGraphics } from "resium";

import "./App.css";

function App() {
  return (
    <Viewer full>
      <Entity
        name="BoxGraphics"
        description="BoxGraphics!!"
        position={Cartesian3.fromDegrees(0, 0, 0)}
      >
        <BoxGraphics
          material={Color.RED}
          dimensions={new Cartesian3(400000.0, 300000.0, 500000.0)}
        />
      </Entity>
    </Viewer>
  );
}

export default hot(App);


Has anyone encountered this bug before, and can refer to me to any resources that might be of help? Thanks

@rot1024
Copy link
Member

rot1024 commented Sep 30, 2020

What Cesium and Resium's version are you using?

@jabusir
Copy link
Author

jabusir commented Sep 30, 2020

hi rot @rot1024,

I'm using:
cesium 1.73.0
resium 1.13.0
craco-cesium 1.2.0

@rot1024
Copy link
Member

rot1024 commented Sep 30, 2020

I tried to update the example project in the Resium repository as following:

app.js

import React from "react";
import { Cartesian3, Color } from "cesium";
import { Viewer, Entity, BoxGraphics } from "resium";

function App() {
  return (
    <Viewer full>
      <Entity
        name="BoxGraphics"
        description="BoxGraphics!!"
        position={Cartesian3.fromDegrees(0, 0, 0)}
      >
        <BoxGraphics
          material={Color.RED}
          dimensions={new Cartesian3(400000.0, 300000.0, 500000.0)}
        />
      </Entity>
    </Viewer>
  );
}

export default App;

And then it works well:

localhost_3000_

So I guess that the issue is due to your environment. If you use yarn, try to delete yarn.lock and reinstall modules.

@rot1024
Copy link
Member

rot1024 commented Sep 30, 2020

Also, I tried it at https://github.com/rot1024/create-react-app-cesium-example and I found the issue. So I guess the issue occurs only in the CRA environment. I am investigating it...

image

@rot1024
Copy link
Member

rot1024 commented Sep 30, 2020

I found there is a bug in Resium. I will fix it soon and release a new version. Thank you!

@rot1024 rot1024 added the bug label Sep 30, 2020
@rot1024
Copy link
Member

rot1024 commented Sep 30, 2020

v1.13.1 has been released! Try it!

@rot1024 rot1024 closed this as completed Sep 30, 2020
@jabusir
Copy link
Author

jabusir commented Sep 30, 2020

Wow, thank you! Very much appreciated :)

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

2 participants