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

Difference between the onClick in the viewer and the onClick in each entities? #632

Open
federicomarcantognini opened this issue Sep 26, 2023 · 0 comments

Comments

@federicomarcantognini
Copy link

I would like to get the metadata from the clicked instance, I can achieve that by either onClick as a prop on the entity and in the viewer. What is the difference and what's faster?

in the viewer:
<Viewer onClick={(e, target) => { if (target?.id instanceof Entity) { // target.id is an Entity! } else if (target?.primitive instanceof Primitive) { // target.id is a Primitive! } else if (target instanceof Cesium3DTileFeature) { // target is a Cesium3DTileFeature! } }} />

in the Entity:
onClick={(moment, entity) => onClick(entity.id._name, moment)}

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

No branches or pull requests

1 participant