Skip to content

Commit

Permalink
Fix picking for feature at index 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
josephbirkner committed Oct 20, 2023
1 parent 194da3e commit cb619e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions static/erdblick/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class ErdblickView
// Add a handler for selection.
this.mouseHandler.setInputAction(movement => {
let feature = this.viewer.scene.pick(movement.position);
if (feature && feature.id && this.tileLayerForPrimitive.has(feature.primitive))
if (feature && feature.id !== undefined && this.tileLayerForPrimitive.has(feature.primitive))
this.setPickedCesiumFeature(feature);
else
this.setPickedCesiumFeature(null);
Expand All @@ -59,7 +59,7 @@ export class ErdblickView
// Add a handler for hover (i.e., MOUSE_MOVE) functionality.
this.mouseHandler.setInputAction(movement => {
let feature = this.viewer.scene.pick(movement.endPosition); // Notice that for MOUSE_MOVE, it's endPosition
if (feature && feature.id && this.tileLayerForPrimitive.has(feature.primitive))
if (feature && feature.id !== undefined && this.tileLayerForPrimitive.has(feature.primitive))
this.setHoveredCesiumFeature(feature);
else
this.setHoveredCesiumFeature(null);
Expand Down

0 comments on commit cb619e1

Please sign in to comment.