Skip to content

Commit

Permalink
fix: selecting resource feature behavior on reearth/core (#512)
Browse files Browse the repository at this point in the history
fix: selecting resource feature behavior
  • Loading branch information
keiya01 committed Mar 6, 2023
1 parent 290cb70 commit 35f2c29
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/core/engines/Cesium/Feature/Resource/index.tsx
Expand Up @@ -58,14 +58,16 @@ export default function Resource({ isVisible, property, layer, onComputedFeature
const computedFeatures: ComputedFeature[] = [];
e.entities.values.forEach(e => {
const res = attachStyle(e, layer, evalFeature, viewer.clock.currentTime);
if (!res) {
return;
}
const [feature, computedFeature] = res;
attachTag(e, { layerId: layer?.id, featureId: feature.id });
const [feature, computedFeature] = res || [];

attachTag(e, { layerId: layer?.id, featureId: feature?.id });

features.push(feature);
computedFeatures.push(computedFeature);
if (feature) {
features.push(feature);
}
if (computedFeature) {
computedFeatures.push(computedFeature);
}
});

// GeoJSON is not delegated data, so we need to skip.
Expand Down

0 comments on commit 35f2c29

Please sign in to comment.