From 8a6d84ca3df57249204f8fd2b027d3be9ca70a78 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Thu, 27 Aug 2026 09:56:47 +0700 Subject: [PATCH] Fix map tiles (drop keyed CARTO for free OSM + CSS dark filter), restore corrupted parseSkateCoach in types.ts Co-authored-by: shakespeare.diy --- src/components/SpotMap.tsx | 9 +++++++-- src/index.css | 8 ++++++++ src/lib/types.ts | 13 +------------ src/pages/MapPage.tsx | 4 +--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/components/SpotMap.tsx b/src/components/SpotMap.tsx index bf9abcc..9b79853 100644 --- a/src/components/SpotMap.tsx +++ b/src/components/SpotMap.tsx @@ -852,10 +852,15 @@ export function SpotMap({ maxBoundsViscosity: 1.0, }); - L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png', { + // Free, no-API-key basemap: OpenStreetMap standard tiles, darkened via a CSS + // filter (see the `.skatespots-dark-tiles` rule in index.css) so it matches + // the app's dark theme without depending on a keyed provider like CARTO. + L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '', - subdomains: 'abcd', + subdomains: 'abc', minZoom: 2, + maxZoom: 19, + className: 'skatespots-dark-tiles', }).addTo(map); // Add click handler if enabled diff --git a/src/index.css b/src/index.css index 507e826..9ee1f7d 100644 --- a/src/index.css +++ b/src/index.css @@ -724,3 +724,11 @@ select { height: 54mm !important; } } + +/* ── Dark basemap without a keyed tile provider ── + We use free OpenStreetMap standard tiles and darken them client-side with a + CSS filter so the map matches the app's dark UI. Applied via the tileLayer + `className: 'skatespots-dark-tiles'` in SpotMap.tsx. */ +.skatespots-dark-tiles { + filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9) saturate(0.7); +} diff --git a/src/lib/types.ts b/src/lib/types.ts index 23536c2..7877ac2 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -1735,18 +1735,7 @@ export interface TourSponsor { challengeId?: string; // If sponsoring a specific challenge } -export function parseSkateJudge(event: NostrEvent): SkateJudge | null { - if (event.kind !== SKATE_JUDGE_KIND) return null; - - const judge = { - name: event.tags.find(([name]) => name === 'name')?.[1] || 'Unknown Judge', - expertise: event.tags.find(([name]) => name === 'expertise')?.[1] || '', - experience: event.tags.find(([name]) => name === 'experience')?.[1] || '', - events_judged: event.tags.find(([name]) => name === 'events_judged')?.[1] || '0', - }; - - return judge; -} +export function parseSkateCoach(event: NostrEvent): SkateCoach | null { if (event.kind !== SKATE_COACH_KIND) return null; const d = event.tags.find(([name]) => name === 'd')?.[1]; diff --git a/src/pages/MapPage.tsx b/src/pages/MapPage.tsx index a94c651..0f546bd 100644 --- a/src/pages/MapPage.tsx +++ b/src/pages/MapPage.tsx @@ -1631,9 +1631,7 @@ export default function MapPage() { className="absolute left-1.5 z-[999] pointer-events-none bottom-[calc(5rem+env(safe-area-inset-bottom,0px)+0.25rem)] md:bottom-1.5" >
- CARTO - {' · '} - OSM + © OpenStreetMap {showBtcMap && ( <>{' · '}BTC Map )}