-
Is there a way to add a multiline Text to the label? If its not possible currently, I think it would be a great feature to add. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Very sorry for the late response, unfortunately, we can't add any HTML attributes or even add a |
Beta Was this translation helpful? Give feedback.
-
Same problem here, and found a workaround to this with some JS DOM magic. const labelGroupElement = document.getElementById('jvm-markers-labels-group')
if (labelGroupElement) {
for (const child of labelGroupElement.children) {
const markerName = child.innerHTML
const location = data.locations.find(
(marker) => marker.displayLocation === markerName,
)
const region = location?.displayRegion
const x = child.getAttribute('x')
child.innerHTML = `
<tspan x="${x}" dy="-0.3em" font-size="16" font-weight="bold">${markerName}</tspan>
<tspan x="${x}" dy="1.2em" fill="rgb(182 185 191)" font-weight="bold">${region}</tspan>
`
const translateX = location?.coordsLabelTranslate[0] ?? '0'
const translateY = location?.coordsLabelTranslate[1] ?? '0'
child.setAttribute('transform', `translate(${translateX}, ${translateY})`)
}
} |
Beta Was this translation helpful? Give feedback.
Same problem here, and found a workaround to this with some JS DOM magic.
Just find the label elements and replace the innerHTML with multiline
<tspan>
elements: