const iconUrl = label.tag?.iconUrl
let imageElement: SVGImageElement | undefined
if (iconUrl) {
imageElement = document.createElementNS(
'http://www.w3.org/2000/svg',
'image'
)
imageElement.setAttribute('href', iconUrl)
imageElement.setAttribute('width', String(iconSize))
imageElement.setAttribute('height', String(iconSize))
const translateX = labelSize.width - iconSize - padding
imageElement.setAttribute(
'transform',
`translate(${translateX} ${padding})`
)
}