@ -91,6 +91,20 @@ export class Label extends OverlayViewSafe {
}
/**
* Get the class of the label div elements.
*
* **Note**: This will always return the default `marker-label`.
*/
get className(): string {
return this.labelDiv.className;
* Set the class of the label div elements.
* **Note**: The default `marker-label` will additionaly be added.
set className(className: string) {
this.labelDiv.className = className;
this.labelDiv.classList.add(LABEL_CLASS);
@ -100,3 +100,10 @@ test("should not have interactive listeners if no map", () => {
0
);
});
test("should set class on label", () => {
const marker = new MarkerWithLabel({ labelContent: "foo" });
const className = "bar baz";
marker.labelClass = className;
expect(marker.labelClass).toMatch(className);
@ -89,6 +89,14 @@ export class MarkerWithLabel extends MarkerSafe {
return this.getClickable() || this.getDraggable();
get labelClass() {
return this.label.className;
set labelClass(className: string) {
this.label.className = className;
setMap(map: google.maps.Map | google.maps.StreetViewPanorama | null): void {
super.setMap(map);
setTimeout(() => {