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

Elevate a polygon #60

Open mondonomo opened 3 years ago

mondonomo commented 3 years ago

@vasturiano congrats on the nice project!

I am using pointOfView to navigate to a selected country. Is there any option to elevate a polygon (based on x,y or the order of polygon data), (the same effect I can gt on hoover).

thanks

vasturiano commented 3 years ago

@mondonomo you can easily control a polygon's elevation using polygonAltitude. It's all about when do you trigger it. So, can you expand on what you mean by "based on x,y or the order of polygon data"?

mondonomo commented 3 years ago

@vasturiano I rotate the globe (with countries polygon) using world.pointOfView({'lat': c[position].lat, 'lng':c[position].lng, 'altitude':c[position].alt }, 2000); After the globe finish rotation, I would like to elevate (change polygonAltitude) of the polygon at that lattitue and longitute, but I do now know how to find the polygon (country) that occupy that position.

vasturiano commented 3 years ago

@mondonomo you could use some intersection math to find which of the polygon objects includes the desired lat,lng point. For example you could use d3-geo geoContains for this purpose.