vasturiano / react-globe.gl

React component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/react-globe.gl/example/world-population/
MIT License
866 stars 155 forks source link

Is it possible to have HTML for labelText? #83

Closed ottpeter closed 2 years ago

ottpeter commented 2 years ago

I would like to have a custom button as label. I managed to have a custom label-hover, but I would need a custom label.

That would also solve my problem if I would be able to have the hover activated for all of the labels.

ottpeter commented 2 years ago

Ok, sorry, I found it, I will have to use htmlElement for this instead of label https://github.com/vasturiano/react-globe.gl#html-elements-layer

ottpeter commented 2 years ago

I still couldn't solve this, because in react-globe.gl.d.ts there is no htmlElementsData Copy-pasting code from here https://github.com/vasturiano/react-globe.gl/blob/master/example/html-markers/index.html does not work, because there is no such property htmlElementsData.

Is there a way to solve this? Thank you!

vasturiano commented 2 years ago

@ottpeter the types should be there: https://github.com/vasturiano/react-globe.gl/blob/8e7455cfde607ce481c4a91e33777004b676f071/src/index.d.ts#L214

Can also be seen at https://unpkg.com/react-globe.gl/dist/react-globe.gl.d.ts.

ottpeter commented 2 years ago

I will try to reinstall it.

ottpeter commented 2 years ago

Reinstalling Globe.GL using the command npm install --save react-globe.gl solved the problem. Now I have htmlElementsData in react-globe.gl.d.ts and the application works.

Thank you for your help! I like your project a lot.