fmt
This commit is contained in:
parent
2f149503bb
commit
6ea544a0f6
10 changed files with 144 additions and 60 deletions
|
|
@ -83,9 +83,7 @@ describe('map utilities', () => {
|
|||
expect(getPoiIconUrl('M&S', '🛒', undefined, 'M&S Simply Food')).toBe(
|
||||
'/assets/poi-icons/visuals/mns.svg'
|
||||
);
|
||||
expect(getPoiIconUrl('Tian Tian', '🛒')).toMatch(
|
||||
/^data:image\/svg\+xml;charset=utf-8,/
|
||||
);
|
||||
expect(getPoiIconUrl('Tian Tian', '🛒')).toMatch(/^data:image\/svg\+xml;charset=utf-8,/);
|
||||
});
|
||||
|
||||
it('keeps POI icon URLs bundled locally', () => {
|
||||
|
|
|
|||
|
|
@ -358,9 +358,8 @@ function getGeneratedPoiLogoUrl(label: string): string {
|
|||
const cached = generatedPoiLogoCache.get(key);
|
||||
if (cached) return cached;
|
||||
|
||||
const [background, foreground] = GENERATED_POI_LOGO_COLORS[
|
||||
hashLabel(key) % GENERATED_POI_LOGO_COLORS.length
|
||||
];
|
||||
const [background, foreground] =
|
||||
GENERATED_POI_LOGO_COLORS[hashLabel(key) % GENERATED_POI_LOGO_COLORS.length];
|
||||
const initials = escapeSvgText(getPoiLogoInitials(key));
|
||||
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256"><rect width="256" height="256" rx="48" fill="${background}"/><text x="128" y="144" text-anchor="middle" font-family="Inter,Arial,sans-serif" font-size="82" font-weight="800" fill="${foreground}">${initials}</text></svg>`;
|
||||
const url = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue