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

billboard text label #243

Closed
NirAbel opened this issue Feb 11, 2020 · 5 comments
Closed

billboard text label #243

NirAbel opened this issue Feb 11, 2020 · 5 comments
Labels

Comments

@NirAbel
Copy link

NirAbel commented Feb 11, 2020

Hi,
how can i pick a billboard from my billboard collection (with mouse click) in resium and add a text form with all his details (speed, height and more..) next to my billboard.
i can't find any text form to add to my code that working for me.

thank you!
Nir

@rot1024
Copy link
Member

rot1024 commented Feb 12, 2020

An entity is recommended unless a number of the data is massive. It can have multiple visualizers: e.g. point, label, billboard.

<Entity position={...} onClick={...}>
  <BillboradGraphics ... />
  <LabelGraphics ... />
</Entity>

@NirAbel
Copy link
Author

NirAbel commented Feb 12, 2020

thank you but i'm not sure how to use it.
i have drones component, they are from billboard.
i want to click with my mouth on my billboard and to get new form window with all the information that i choose to add to my form.
i can't find example to BillboardGraphics this is the solution for my problem?
can you give me an example for how to write it?
thank you very much!
Nir

@rot1024
Copy link
Member

rot1024 commented Feb 12, 2020

Here is example of graphics:

https://resium.darwineducation.com/examples/?path=/story/entity--graphics

Please open "story" tab and you can refer to example codes.

@NirAbel
Copy link
Author

NirAbel commented Feb 12, 2020

amazing thank you!
is it possible to make the LableGraphics to show on click and disappear with another one (on the billboard)?
thank you!!

@rot1024
Copy link
Member

rot1024 commented Feb 12, 2020

If you are familiar with React, it may be easy.

const Component = ({ entities }) => {
  const [labelDisplayedEntity, setLabelDisplayedEntity] = useState();
  return (
    <Viewer>
      {entities.map(e => (
        <Entity
          key={e.id} 
          id={e.id}
          position={e.position}
          onClick={(e2) => setLabelDisplayedEntity(e2.id)}>
          <BillboardGraphics ... />
          <LabelGraphics show={labelDisplayedEntity === e.id} ... />
        </Entity>
      )}
    </Viewer>
  );
};

@rot1024 rot1024 closed this as completed Feb 17, 2020
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