Skip to content

Commit

Permalink
fix: prevent selecting not shown feature for MVT on reearth/core (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
keiya01 authored Mar 30, 2023
1 parent e138bd6 commit 41816de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/engines/Cesium/Feature/Raster/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ export const useMVT = ({
: idFromGeometry(mvtFeature.loadGeometry(), tile);
const feature = evalFeature(layer, makeFeatureFromPolygon(id, mvtFeature, tile));
const info = new ImageryLayerFeatureInfo();
info.data = { layerId: layer?.id, featureId: id, feature };
info.data = {
layerId: layer?.id,
featureId: id,
feature,
appearanceType: VectorTileFeature.types[mvtFeature.type].toLowerCase(),
};
return info;
},
});
Expand Down
5 changes: 5 additions & 0 deletions src/core/engines/Cesium/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,11 @@ export default ({
const l = await scene.imageryLayers.pickImageryLayerFeatures(pickRay, scene);
if (l && !!l.length) {
l.map(f => {
const appearanceType = f.data?.appearanceType;
if (appearanceType && f.data?.feature?.[appearanceType]?.show === false) {
return;
}

const pos = f.position;
if (pos) {
// NOTE: Instantiate temporal Cesium.Entity to display indicator.
Expand Down

0 comments on commit 41816de

Please sign in to comment.