You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)}
The text was updated successfully, but these errors were encountered:
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)}
The text was updated successfully, but these errors were encountered: