79599991

Date: 2025-04-30 09:25:23
Score: 0.5
Natty:
Report link

In general, if you just want to rotate the tooltips text, just bind the tooltip using a new div for the text:

marker.bindTooltip(
    `<div>${text}</div>`,
    {
        permanent: true,
        direction: 'center',
        className: "markerText"
    }
);

and when rotating the marker, just rotate the text in the div:

marker.setRotationAngle(newAngle);
const tooltip = marker.getTooltip();
if (tooltip) {
    tooltip.setContent(`<div style="transform: rotate(${newAngle}deg); transform-origin: center center;">${text}</div>`);
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: twakain