From cb619e103dc67841c8a18b9401315cb5b18a760a Mon Sep 17 00:00:00 2001 From: Joseph Birkner Date: Fri, 20 Oct 2023 16:17:15 +0200 Subject: [PATCH] Fix picking for feature at index 0. --- static/erdblick/view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/erdblick/view.js b/static/erdblick/view.js index 6a4fda11..9f300ff6 100644 --- a/static/erdblick/view.js +++ b/static/erdblick/view.js @@ -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); @@ -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);