vasturiano / globe.gl

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

Help with label font #213

Open mostlyrand0m opened 2 months ago

mostlyrand0m commented 2 months ago

Thank you for globe.gl. You can see my project at http://www.maptap.gg/

I'm trying to change the font on the label and I'm clearly doing something dumb. I'm unable to get .labelTypeFace to work.

const myGlobe = Globe() (globeContainer) .globeImageUrl('https://unpkg.com/three-globe/example/img/earth-blue-marble.jpg') .labelTypeFace('helvetiker_bold') .pointOfView({ lat: 0, lng: 0, altitude: 2 });

Are there any examples of using .labelTypeFace ?

vasturiano commented 1 month ago

@mostlyrand0m thanks for reaching out.

You need to pass the whole typeface object itself, not just a string with the name. There's a few to choose from here: https://github.com/mrdoob/three.js/tree/dev/examples/fonts

But anything generated with Facetype.js should work.