Skip to content

Commit

Permalink
Fix update icon in default marker (#18)
Browse files Browse the repository at this point in the history
<!--

Thank you for submitting a pull request!

Here's a checklist you might find useful.
[ ] There is an associated issue that is labelled
  'Bug' or 'help wanted' or is in the Community milestone
[ ] Code is up-to-date with the `main` branch
[ ] You've successfully run `npm test` locally
[ ] There are new or updated tests validating the change

-->

Fixes #
  • Loading branch information
matthew44-mappable authored Jun 20, 2024
1 parent 1614ab0 commit a80d31c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/markers/MMapDefaultMarker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ export class MMapDefaultMarker extends mappable.MMapComplexEntity<MMapDefaultMar
}
}

if (this._props.iconName !== oldProps.iconName) {
const icon = this._getIcon();
this._icon.innerHTML = icon;
}

this._titleHint.textContent = title ?? '';
this._subtitleHint.textContent = subtitle ?? '';
const hintAttached = this._markerElement.contains(this._hintContainer);
Expand Down Expand Up @@ -315,7 +320,7 @@ export class MMapDefaultMarker extends mappable.MMapComplexEntity<MMapDefaultMar
return '';
}

return icons[this._props.iconName];
return icons[this._props.iconName] ?? '';
}

private _getColor(): ThemesColor {
Expand Down

0 comments on commit a80d31c

Please sign in to comment.