From 75b32d7c1de92bd4c5e69cc04a181fe5d78945d7 Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Mon, 5 Jan 2026 16:58:05 -0500 Subject: [PATCH] feat: add dynamic lodging icons based on type in CollectionMap component --- .../lib/components/collections/CollectionMap.svelte | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/collections/CollectionMap.svelte b/frontend/src/lib/components/collections/CollectionMap.svelte index 2ca66375..f5fe4eb2 100644 --- a/frontend/src/lib/components/collections/CollectionMap.svelte +++ b/frontend/src/lib/components/collections/CollectionMap.svelte @@ -2,7 +2,7 @@ import FullMap, { type FullMapFeatureCollection } from '$lib/components/map/FullMap.svelte'; import { GeoJSON, LineLayer, Marker } from 'svelte-maplibre'; import { goto } from '$app/navigation'; - import { getActivityColor } from '$lib'; + import { LODGING_TYPES_ICONS, getActivityColor } from '$lib'; import SearchIcon from '~icons/mdi/magnify'; import FilterIcon from '~icons/mdi/filter-variant'; import ChevronDown from '~icons/mdi/chevron-down'; @@ -130,6 +130,15 @@ return t?.date || t?.start_date || t?.end_date || null; } + function getLodgingIcon(type?: string | null): string { + if (!type) return '🏨'; + const key = String(type).toLowerCase().trim(); + if (key in LODGING_TYPES_ICONS) { + return LODGING_TYPES_ICONS[key as keyof typeof LODGING_TYPES_ICONS]; + } + return '🏨'; + } + function getTransportIcon(type?: string | null): string { if (!type) return '✈️'; const normalized = String(type).toLowerCase(); @@ -172,7 +181,7 @@ properties: { id: String(l.id), name: l.name || 'Lodging', - categoryIcon: '🏨', + categoryIcon: getLodgingIcon(l.type), categoryName: l.type || 'Lodging', type: 'lodging', date: l.check_in || l.check_out || null