vasturiano / three-globe

WebGL Globe Data Visualization as a ThreeJS reusable 3D object
https://vasturiano.github.io/three-globe/example/links/
MIT License
1.19k stars 145 forks source link

.htmlElementsData() and .htmlElement() causes an uncaught type error - missing definition? #52

Closed divljikunic closed 2 years ago

divljikunic commented 2 years ago

Using .htmlElementsData() and .htmlElement() causes a "Uncaught TypeError: ...is not a function"

Going to the definition in "three-globe.d.ts", nothing resembling those functions exists there. As per the docs, there are hexes, polygons, custom layers etc. but no html elements.

Steps to reproduce the behavior:

  1. initialize an instance of ThreeGlobe() and try using the .htmlElementsData() or .htmlElement()
vasturiano commented 2 years ago

@divljikunic thanks for reaching out.

The type definitions should be there: https://github.com/vasturiano/three-globe/blob/bc8492286aebc27d6bc875aafb0254e0964f9242/src/index.d.ts#L264-L276

Are you using a recent version of the package?

divljikunic commented 2 years ago

I did an 'npm update' and the error is indeed gone! Thank you. I had installed the package just recently, so it didn't occur to me this could even be an issue.