1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-03 20:25:18 +02:00

[REQUEST] Add Lodgings to Map #509

This commit is contained in:
Sean Morley 2025-03-15 23:44:22 -04:00
parent 7fbcf170d0
commit a640934370

View file

@ -28,7 +28,8 @@
groupTransportationsByDate, groupTransportationsByDate,
groupChecklistsByDate, groupChecklistsByDate,
osmTagToEmoji, osmTagToEmoji,
groupLodgingByDate groupLodgingByDate,
ADVENTURE_TYPE_ICONS
} from '$lib'; } from '$lib';
import ChecklistCard from '$lib/components/ChecklistCard.svelte'; import ChecklistCard from '$lib/components/ChecklistCard.svelte';
import ChecklistModal from '$lib/components/ChecklistModal.svelte'; import ChecklistModal from '$lib/components/ChecklistModal.svelte';
@ -46,6 +47,14 @@
return marked(markdown); return marked(markdown);
}; };
function getLodgingIcon(type: string) {
if (type in ADVENTURE_TYPE_ICONS) {
return ADVENTURE_TYPE_ICONS[type as keyof typeof ADVENTURE_TYPE_ICONS];
} else {
return '🏨';
}
}
let collection: Collection; let collection: Collection;
// add christmas and new years // add christmas and new years
@ -1031,6 +1040,28 @@
</Marker> </Marker>
{/if} {/if}
{/each} {/each}
{#each lodging as hotel}
{#if hotel.longitude && hotel.latitude}
<Marker
lngLat={{
lng: hotel.longitude,
lat: hotel.latitude
}}
class="grid h-8 w-8 place-items-center rounded-full border border-gray-200
bg-yellow-300 text-black focus:outline-6 focus:outline-black"
>
<span class="text-xl">
{getLodgingIcon(hotel.type)}
</span>
<Popup openOn="click" offset={[0, -10]}>
<div class="text-lg text-black font-bold">{hotel.name}</div>
<p class="font-semibold text-black text-md">
{hotel.type}
</p>
</Popup>
</Marker>
{/if}
{/each}
</MapLibre> </MapLibre>
</div> </div>
</div> </div>