@ -79,6 +79,10 @@ export class Label extends OverlayViewSafe {
}
get content(): string | HTMLElement {
return this.labelDiv.innerHTML;
set content(content: string | HTMLElement) {
if (typeof content === "string") {
this.labelDiv.innerHTML = content;
@ -116,3 +116,10 @@ test("should set class on label", () => {
marker.labelClass = className;
expect(marker.labelClass).toMatch(className);
});
test("should set content on label", () => {
const marker = new MarkerWithLabel({ labelContent: "foo" });
const newConent = "bar";
marker.labelContent = newConent;
expect(marker.labelContent).toMatch(newConent);
@ -97,6 +97,14 @@ export class MarkerWithLabel extends MarkerSafe {
return this.getClickable() || this.getDraggable();
get labelContent(): string | HTMLElement {
return this.label.content;
set labelContent(content: string | HTMLElement) {
this.label.content = content;
get labelClass() {
return this.label.className;