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:
parent
7fbcf170d0
commit
a640934370
1 changed files with 32 additions and 1 deletions
|
@ -28,7 +28,8 @@
|
|||
groupTransportationsByDate,
|
||||
groupChecklistsByDate,
|
||||
osmTagToEmoji,
|
||||
groupLodgingByDate
|
||||
groupLodgingByDate,
|
||||
ADVENTURE_TYPE_ICONS
|
||||
} from '$lib';
|
||||
import ChecklistCard from '$lib/components/ChecklistCard.svelte';
|
||||
import ChecklistModal from '$lib/components/ChecklistModal.svelte';
|
||||
|
@ -46,6 +47,14 @@
|
|||
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;
|
||||
|
||||
// add christmas and new years
|
||||
|
@ -1031,6 +1040,28 @@
|
|||
</Marker>
|
||||
{/if}
|
||||
{/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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue