diff --git a/packages/markers-plugin/src/Marker.ts b/packages/markers-plugin/src/Marker.ts index f266d318f..f91257153 100644 --- a/packages/markers-plugin/src/Marker.ts +++ b/packages/markers-plugin/src/Marker.ts @@ -364,18 +364,18 @@ export class Marker { } else { element.classList.add('psv-marker--poly'); } - - // add CSS classes - if (this.config.className) { - utils.addClasses(element, this.config.className); + if (this.state.visible) { + element.classList.add('psv-marker--visible'); } - if (this.config.tooltip) { element.classList.add('psv-marker--has-tooltip'); } if (this.config.content) { element.classList.add('psv-marker--has-content'); } + if (this.config.className) { + utils.addClasses(element, this.config.className); + } // apply style element.style.opacity = `${this.config.opacity ?? 1}`;