feat(map): implement dynamic basemap URL based on theme; update map styles across components

This commit is contained in:
Sean Morley
2025-06-13 23:49:14 -04:00
parent badeac867d
commit d4c76f8718
11 changed files with 55 additions and 17 deletions

View File

@@ -19,7 +19,7 @@
import AdventureModal from '$lib/components/AdventureModal.svelte';
import ImageDisplayModal from '$lib/components/ImageDisplayModal.svelte';
import AttachmentCard from '$lib/components/AttachmentCard.svelte';
import { isAllDay } from '$lib';
import { getBasemapUrl, isAllDay } from '$lib';
let geojson: any;
@@ -600,7 +600,7 @@
<div class="rounded-lg overflow-hidden shadow-lg">
<MapLibre
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
style={getBasemapUrl()}
class="w-full h-96"
standardControls
center={{ lng: adventure.longitude || 0, lat: adventure.latitude || 0 }}

View File

@@ -280,14 +280,14 @@
{activeView === 'owned'
? 'No collections yet'
: activeView === 'shared'
? 'No shared collections'
? 'No shared collections.'
: 'No archived collections'}
</h3>
<p class="text-base-content/50 text-center max-w-md">
{activeView === 'owned'
? 'Create your first collection to organize your adventures and memories.'
: activeView === 'shared'
? 'Collections shared with you will appear here.'
? 'Make sure your profile is public so others can share with you.'
: 'Archived collections will appear here.'}
</p>
{#if activeView === 'owned'}
@@ -429,7 +429,7 @@
</div>
<!-- Quick Actions -->
<div class="space-y-3 mt-6">
<!-- <div class="space-y-3 mt-6">
<button
type="button"
class="btn btn-outline w-full gap-2"
@@ -438,7 +438,7 @@
<Archive class="w-4 h-4" />
{$t(`adventures.archived_collections`)}
</button>
</div>
</div> -->
</div>
</div>
</div>

View File

@@ -30,7 +30,8 @@
groupChecklistsByDate,
osmTagToEmoji,
groupLodgingByDate,
LODGING_TYPES_ICONS
LODGING_TYPES_ICONS,
getBasemapUrl
} from '$lib';
import ChecklistCard from '$lib/components/ChecklistCard.svelte';
import ChecklistModal from '$lib/components/ChecklistModal.svelte';
@@ -1233,7 +1234,7 @@
<div class="card-body">
<h2 class="card-title text-3xl justify-center mb-4">Trip Map</h2>
<MapLibre
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
style={getBasemapUrl()}
class="aspect-[9/16] max-h-[70vh] sm:aspect-video sm:max-h-full w-full rounded-lg"
standardControls
>
@@ -1459,7 +1460,7 @@
{#if recomendationsData}
<MapLibre
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
style={getBasemapUrl()}
class="aspect-[9/16] max-h-[70vh] sm:aspect-video sm:max
-h-full w-full rounded-lg"
standardControls

View File

@@ -5,6 +5,7 @@
import type { Adventure, VisitedRegion } from '$lib/types.js';
import CardCarousel from '$lib/components/CardCarousel.svelte';
import { goto } from '$app/navigation';
import { getBasemapUrl } from '$lib';
export let data;
let createModalOpen: boolean = false;
@@ -117,7 +118,7 @@
{/if}
<MapLibre
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
style={getBasemapUrl()}
class="mx-auto aspect-[9/16] max-h-[70vh] sm:aspect-video sm:max-h-full w-10/12 rounded-lg"
standardControls
>

View File

@@ -16,6 +16,7 @@
import Check from '~icons/mdi/check-circle';
import Progress from '~icons/mdi/progress-check';
import Cancel from '~icons/mdi/cancel';
import { getBasemapUrl } from '$lib';
export let data: PageData;
console.log(data);
@@ -230,7 +231,7 @@
<div class="card bg-base-100 shadow-xl">
<div class="card-body p-4">
<MapLibre
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
style={getBasemapUrl()}
class="aspect-[16/10] w-full rounded-lg"
standardControls
zoom={2}

View File

@@ -19,6 +19,7 @@
import Trophy from '~icons/mdi/trophy';
import Target from '~icons/mdi/target';
import Flag from '~icons/mdi/flag';
import { getBasemapUrl } from '$lib';
export let data: PageData;
@@ -281,7 +282,7 @@
</div>
</div>
<MapLibre
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
style={getBasemapUrl()}
class="aspect-[16/10] w-full rounded-lg"
standardControls
center={[regions[0]?.longitude || 0, regions[0]?.latitude || 0]}

View File

@@ -1,4 +1,5 @@
<script lang="ts">
import { getBasemapUrl } from '$lib';
import CityCard from '$lib/components/CityCard.svelte';
import { addToast } from '$lib/toasts';
import type { City } from '$lib/types';
@@ -102,7 +103,7 @@
<!-- checkbox to toggle marker -->
<MapLibre
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
style={getBasemapUrl()}
class="aspect-[9/16] max-h-[70vh] sm:aspect-video sm:max-h-full w-10/12 rounded-lg"
standardControls
center={allCities[0] && allCities[0].longitude !== null && allCities[0].latitude !== null