melowntech / vts-browser-js

JavaScript WebGL 3D map rendering engine
BSD 2-Clause "Simplified" License
218 stars 42 forks source link

Hover events #207

Closed jrjdavidson closed 3 years ago

jrjdavidson commented 3 years ago

Hi,

was testing hover events and am having some issues- only a few of the shorter lines generated are working. See test here: https://www.holoceneadventures.com/ivft2/hoverTest.html you'll find that only the inner 3 lines hover properly.

Are there any limitations to hover events, such as line length?

ghost commented 3 years ago

Hi jrjdavidson,

Well, to be honest, I haven't tried to understand your app but I could see something fishy in the input data... I think the problem is in isopachPolyline.json, you give an ID to the first 3 lines only. The hover events are working when all lines have an ID:

@@ -339,8 +339,9 @@
               ]
             ]
           ],
+          "id": 4,
           "properties": {
-            "id": null,
+            "id": 4,
             "isovalue": 5
           }
         },
@@ -439,8 +440,9 @@
               ]
             ]
           ],
+          "id": 5,
           "properties": {
-            "id": null,
+            "id": 5,
             "isovalue": 3
           }
         },
@@ -574,8 +576,9 @@
               ]
             ]
           ],
+          "id": 6,
           "properties": {
-            "id": null,
+            "id": 6,
             "isovalue": 2
           }
         },
@@ -709,8 +712,9 @@
               ]
             ]
           ],
+          "id": 7,
           "properties": {
-            "id": null,
+            "id": 7,
             "isovalue": 1
           }
         },
@@ -819,8 +823,9 @@
               ]
             ]
           ],
+          "id": 8,
           "properties": {
-            "id": null,
+            "id": 8,
             "isovalue": 1
           }
         },
@@ -884,8 +889,9 @@
               ]
             ]
           ],
+          "id": 9,
           "properties": {
-            "id": null,
+            "id": 9,
             "isovalue": 0
           }
         },
@@ -949,8 +955,9 @@
               ]
             ]
           ],
+          "id": 10,
           "properties": {
-            "id": null,
+            "id": 10,
             "isovalue": 0
           }
         },
@@ -1034,8 +1041,9 @@
               ]
             ]
           ],
+          "id": 11,
           "properties": {
-            "id": null,
+            "id": 11,
             "isovalue": 1
           }
         }

Have a great day!

jrjdavidson commented 3 years ago

Yes- that worked!

Not sure how only the first three ended with an id, I'll make sure to pay attention in the future