diff --git a/src/MMapDefaultMarker/index.ts b/src/MMapDefaultMarker/index.ts index 713f0fd..9a4273c 100644 --- a/src/MMapDefaultMarker/index.ts +++ b/src/MMapDefaultMarker/index.ts @@ -3,9 +3,12 @@ import {IconColor, IconName, iconColors, icons, glyphColors} from '../icons'; import './index.css'; import pin from './pin.svg'; +export type ThemesColor = {day: string; night: string}; +export type MarkerColorProps = IconColor | ThemesColor; + export type MMapDefaultMarkerProps = MMapMarkerProps & { iconName?: IconName; - color?: IconColor; + color?: MarkerColorProps; }; const defaultProps = Object.freeze({color: 'darkgray'}); @@ -18,7 +21,7 @@ export class MMapDefaultMarker extends mappable.MMapComplexEntity): void { if (propsDiff.color !== undefined) { - this._color = iconColors[this._props.color]; + this._color = this._getColor(); this._updateTheme(); } - this._icon.innerHTML = this._props.iconName !== undefined ? icons[this._props.iconName].normal : ''; + this._icon.innerHTML = this._getIcon(); this._marker.update(this._props); } @@ -69,4 +70,23 @@ export class MMapDefaultMarker extends mappable.MMapComplexEntity