click on cameras not working #1

Open
opened 2025-10-11 20:38:37 +02:00 by asohh · 2 comments
Collaborator
No description provided.
Collaborator

FYI: The instance hosted on uber.space seems to work fine.
image

Having said that, if I clone and run 522c609ef1 locally, the issue still occurs.

FYI: The instance hosted on `uber.space` seems to work fine. ![image](/attachments/5442d889-bad6-420f-9876-65d000979d27) Having said that, if I clone and run 522c609ef18103132af630d76da2691bd047ba2c locally, the issue still occurs.
283 KiB
Collaborator

Just to document it (maybe you already found it): Your suspicion of missing data being the root cause seems to be correct.

Adding a fallback value to camera:type results in working tooltips (but incorrect visualizations, as now every camera is treated as a 360° camera:

diff --git a/www/sunders/js/leafletembed_functions.js b/www/sunders/js/leafletembed_functions.js
index cb199a0..b42fb34 100644
--- a/www/sunders/js/leafletembed_functions.js
+++ b/www/sunders/js/leafletembed_functions.js
@@ -156,7 +156,7 @@ function onStateChanged() {
             var cameraDirection = getCameraDirection(plotList[i]);
 
             // Draw fixed camera's field of view and add it to map.
-            var cameraType = plotList[i]['camera:type'];
+            var cameraType = plotList[i]['camera:type'] ?? "dome";
 
             if (cameraType == 'fixed' || cameraType == 'static' || cameraType == 'dome') {
               var focusColor = getFocusColor(plotType);

image

From what I can see, the script generates the field of view of the camera (called plotFocus in that file) based on the type of camera. With that data missing, the script fails inside the map.addLayer() call, which throws and forces the script to exit.

Once the initialization and update script supplies that data (#3), the tooltips should work!

Just to document it (maybe you already found it): Your suspicion of missing data being the root cause seems to be correct. Adding a fallback value to `camera:type` results in working tooltips (but incorrect visualizations, as now every camera is treated as a 360° camera: ```patch diff --git a/www/sunders/js/leafletembed_functions.js b/www/sunders/js/leafletembed_functions.js index cb199a0..b42fb34 100644 --- a/www/sunders/js/leafletembed_functions.js +++ b/www/sunders/js/leafletembed_functions.js @@ -156,7 +156,7 @@ function onStateChanged() { var cameraDirection = getCameraDirection(plotList[i]); // Draw fixed camera's field of view and add it to map. - var cameraType = plotList[i]['camera:type']; + var cameraType = plotList[i]['camera:type'] ?? "dome"; if (cameraType == 'fixed' || cameraType == 'static' || cameraType == 'dome') { var focusColor = getFocusColor(plotType); ``` ![image](/attachments/5de8638f-fe94-4dda-9766-eeb2fc6f776f) From what I can see, the script generates the field of view of the camera (called `plotFocus` in that file) based on the type of camera. With that data missing, the script fails inside the `map.addLayer()` call, which throws and forces the script to exit. Once the initialization and update script supplies that data (#3), the tooltips should work!
1.1 MiB
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: CCCHH/sunders#1
No description provided.