Closed BangNguyen1992 closed 10 months ago
@BangNguyen1992 thanks for reaching out.
This was indeed a bug that was just fixed in this underlying module: https://github.com/vasturiano/three-globe/commit/dfa2f8d77d44f11004b47c3b900a0cefa0a44d9b
If you update your dependency tree to include at least v2.27.5
of three-globe
, you shouldn't experience the issue anymore.
Hello @vasturiano, thank you for the quick update, it works for me now.
However, when I change the hexPolygonResolution
value, the app is freezing for about 1~2 sec. Do you have any suggestions on how to prevent that?
Thank you
@BangNguyen1992 are you using high values for the resolution? That would explain the CPU burst. The higher the value the more strain it puts on the Hex processor and more ThreeJS objects get generated.
Hello @vasturiano, I am not sure if changing from 3 to 4 is considered high.
What I want is to have a hex polygon layer but when the user zoom in, I want them to see the hexagon as a rounded shape. Therefore, my idea is to increase the hexPolygonResolution
from 3 to 4 when the user zooms in enough and change it back to 3 when they zoom out.
Hello @vasturiano, I understand that increasing the hexPolygonResolution
CPU burst, thus, making the app freeze.
Is there any way to make the generating new Theejs objects without blocking the transition/animation of the current process? It's fine if the generation takes a longer time.
Example:
hexPolygonResolution
, the globe is still able to rotate smoothly, and the hex processor gradually updates and re-renders with the new hexPolygonResolution
Is it possible to achieve that scenario?
Thank you for this amazing library
@BangNguyen1992 the bulk of the CPU load is caused by the hex coordinate generation by h3-js. I can only imagine what you describe being possible if that operation is offloaded off the main thread using web workers. Unfortunately this is not currently supported in this module, it would be a non-trivial change to add this type of asynchronous functionality.
Thank you @vasturiano, I think I have approached it in the wrong way, which makes the issue become more complicated than it should be. 😅
I am closing the issue now since the bug had been fixed.
Describe the bug I want to change the hexPolygonResolution of the hexPolygon layer when the user zoom in/out. However, after the 1st init, the hexPolygonResolution doesn't update accordingly to the input value. I have tried with function as well, but still still not work.
Example:
hexPolygonResolution={() => zoomIn ? 4 : 3 }
-> but it doesn't change when zoomIn value changedTo Reproduce
hexPolygonResolution
value dynamically like the example aboveExpected behavior
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context