vasturiano / globe.gl

UI component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/globe.gl/example/world-population/
MIT License
1.99k stars 298 forks source link

Performance && Polygon - globe merge #96

Closed Zozor54 closed 2 years ago

Zozor54 commented 2 years ago

Describe the bug Hi, Thanks for your amazing work ! I'm trying to render a globe with a background color and use polygon for create every continent.

If needed i could provide an example.

Screenshots For my first problem :

image

I have to use altitude but if i do that my arc between my points are no more exact.

For my second one if needed i could give you an example.

Desktop (please complete the following information):

Additional context

vasturiano commented 2 years ago

@Zozor54 thanks for reaching out.

For 1. you can increase the polygon curvature resolution (using polygonCapCurvatureResolution) so that your polygons follow the curve of the globe more closely and don't intersect it. It also helps if you give it just a small amount of altitude, to allow for some margin.

For 2. you can try merging point geometries (using .pointsMerge(true)). That might give you better performance.

Zozor54 commented 2 years ago

Thanks for your answer.

For 1. Your solution is perfect thanks.

I actually have an other problem. I'm refreshing my arc every 20s with something like this :

image

I checked my data and i don't find any problem.

image

In my console i can find this error at every data refresh :

image image

Do you have an idea what i'm doing wrong ?

vasturiano commented 2 years ago

@Zozor54 I'm not sure why you're seeing that error. Could you make a reduced example of your case on https://codepen.io where the issue is reproduced so we can look a bit deeper?

Zozor54 commented 2 years ago

@vasturiano I think i just found the problem.

In points whe have the merge option if point are at the same location. But we don't have this option for arc.

My problem was arc had the same source and destination coordinate. Thank you for your help.

vasturiano commented 2 years ago

Thanks for the report @Zozor54!

I've just issued a fix on the underlying lib that handles this edge case more gracefully and doesn't cause an error. Such an arc is of course not visible, but that's another matter. 👍