# Using HTML on labels

**URL:** <https://community.cesium.com/t/using-html-on-labels/7861>\
**Category:** CesiumJS\
**Created:** [January 3, 2019, 2:07pm UTC](https://community.cesium.com/t/using-html-on-labels/7861 "2019-01-03T14:07:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ihsanergun](https://avatars.discourse-cdn.com/v4/letter/i/aeb1de/32.png) [@ihsanergun](https://community.cesium.com/u/ihsanergun)\
**Post date:** [January 3, 2019, 2:07pm UTC](https://community.cesium.com/t/using-html-on-labels/7861/1 "2019-01-03T14:07:48Z")

</div>

Hi everyone,

&nbsp;&nbsp;&nbsp;&nbsp;viewer.entities.add({  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position : Cesium.Cartesian3.fromDegrees(-75.1641667, 39.9522222),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label : {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text : '\<h1\>Philadelphia\</h1\>'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;});

This example displays '\<h1\>Philadelphia\</h1\>'. Is there any posibilty using HTML on labels?

Thanks  
Ihsan

---

<div class="post-metadata">

**Author:** ![Mark\_Erikson](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mark_erikson/32/2024_2.png) [@Mark\_Erikson](https://community.cesium.com/u/Mark_Erikson)\
**Post date:** [January 3, 2019, 4:41pm UTC](https://community.cesium.com/t/using-html-on-labels/7861/2 "2019-01-03T16:41:18Z")

</div>

It’s probably not _directly_ possible. It may be possible to do something similar with a hack-ish workaround.

I recently had a need to draw the contents of some HTML elements into a canvas. It turns out that it’s doable, via some very twisted mechanics.

Fortunately, there’s some libraries on NPM that wrap up the logic for doing this. In particular, see [https://github.com/bubkoo/html-to-image](https://github.com/bubkoo/html-to-image) and [https://github.com/tsayen/dom-to-image](https://github.com/tsayen/dom-to-image) .

What you’d probably need to do is create your HTML elements, use one of those libraries to convert it to a canvas, and assign the canvas as the image of a billboard.

---

<div class="post-metadata">

**Author:** ![ihsanergun](https://avatars.discourse-cdn.com/v4/letter/i/aeb1de/32.png) [@ihsanergun](https://community.cesium.com/u/ihsanergun)\
**Post date:** [January 4, 2019, 6:59am UTC](https://community.cesium.com/t/using-html-on-labels/7861/3 "2019-01-04T06:59:58Z")

</div>

Good idea but I am having trouble with the performance when thousand of objects displayed. However, thanks for your reply.
