From 4128a0ac7dab480d5cf574e70f59ee519ab64fd3 Mon Sep 17 00:00:00 2001 From: Shadowbroker <43977454+BigBodyCobain@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:48:00 -0600 Subject: [PATCH 01/11] fix(basemap): default to keyless OpenFreeMap --- .../src/components/map/styles/mapStyles.ts | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/map/styles/mapStyles.ts b/frontend/src/components/map/styles/mapStyles.ts index 2c0605bb..d4916429 100644 --- a/frontend/src/components/map/styles/mapStyles.ts +++ b/frontend/src/components/map/styles/mapStyles.ts @@ -1,54 +1,60 @@ /** - * MapLibre basemap styles on CARTO raster tiles. CARTO requires an API key - * (unkeyed tiles are watermarked); MaplibreViewer passes one from - * useBasemapConfig() via buildBasemapStyle(). The key is served by the - * backend at GET /api/basemap-config. + * ShadowBroker's zero-config basemap uses OpenFreeMap vector styles. + * Operators who configure CARTO_API_KEY keep the existing CARTO raster + * basemap path. This avoids CARTO's unkeyed "API KEY REQUIRED" watermark + * without taking the configured provider away from existing installs. */ export type BasemapTheme = 'dark' | 'light'; +export const OPENFREEMAP_STYLE_URLS: Record = { + dark: 'https://tiles.openfreemap.org/styles/dark', + light: 'https://tiles.openfreemap.org/styles/positron', +}; + const CARTO_SUBDOMAINS = ['a', 'b', 'c', 'd'] as const; const CARTO_RASTER_STYLE: Record = { dark: 'dark_all', light: 'light_all', }; -const GLYPHS_URL = 'https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf'; -// Declared on the raster source so MapLibre's AttributionControl shows it -// even without the custom list in MaplibreViewer. Same markup as that list so -// the control de-duplicates instead of showing both. export const OSM_ATTRIBUTION_HTML = '© OpenStreetMap contributors'; export const CARTO_ATTRIBUTION_HTML = 'CARTO'; +export const OPENFREEMAP_ATTRIBUTION_HTML = + 'OpenFreeMap · OpenMapTiles'; -/** Tile URL templates for a CARTO raster style, keyed when a key is supplied. */ -export function cartoTileUrls(theme: BasemapTheme, cartoApiKey?: string | null): string[] { +/** Tile URL templates for the optional CARTO raster style. */ +export function cartoTileUrls(theme: BasemapTheme, cartoApiKey: string): string[] { const style = CARTO_RASTER_STYLE[theme]; - const key = (cartoApiKey || '').trim(); - const query = key ? `?key=${encodeURIComponent(key)}` : ''; + const key = cartoApiKey.trim(); return CARTO_SUBDOMAINS.map( - (s) => `https://${s}.basemaps.cartocdn.com/rastertiles/${style}/{z}/{x}/{y}@2x.png${query}`, + (s) => + `https://${s}.basemaps.cartocdn.com/rastertiles/${style}/{z}/{x}/{y}@2x.png?key=${encodeURIComponent(key)}`, ); } +/** + * Use OpenFreeMap by default. CARTO is retained as an opt-in compatibility + * path when an operator has already configured CARTO_API_KEY. + */ export function buildBasemapStyle(theme: BasemapTheme, cartoApiKey?: string | null) { + const key = (cartoApiKey || '').trim(); + if (!key) return OPENFREEMAP_STYLE_URLS[theme]; + const sourceId = `carto-${theme}`; return { version: 8, - glyphs: GLYPHS_URL, sources: { [sourceId]: { type: 'raster', - tiles: cartoTileUrls(theme, cartoApiKey), + tiles: cartoTileUrls(theme, key), tileSize: 256, attribution: `${OSM_ATTRIBUTION_HTML} ${CARTO_ATTRIBUTION_HTML}`, }, }, - layers: [ - { id: `${sourceId}-layer`, type: 'raster', source: sourceId, minzoom: 0, maxzoom: 22 }, - { id: 'imagery-ceiling', type: 'background', paint: { 'background-opacity': 0 } }, - ], + layers: [{ id: `${sourceId}-layer`, type: 'raster', source: sourceId, minzoom: 0, maxzoom: 22 }], }; } From a9cd03f11504c9b87eb02af29bba2a269d8743f8 Mon Sep 17 00:00:00 2001 From: Shadowbroker <43977454+BigBodyCobain@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:48:36 -0600 Subject: [PATCH 02/11] fix(basemap): preserve overlays with keyless vector styles --- frontend/src/components/MaplibreViewer.tsx | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/MaplibreViewer.tsx b/frontend/src/components/MaplibreViewer.tsx index 211ff4b2..408a072c 100644 --- a/frontend/src/components/MaplibreViewer.tsx +++ b/frontend/src/components/MaplibreViewer.tsx @@ -15,7 +15,7 @@ import Map, { } from 'react-map-gl/maplibre'; import 'maplibre-gl/dist/maplibre-gl.css'; import { computeNightPolygon } from '@/utils/solarTerminator'; -import { buildBasemapStyle } from '@/components/map/styles/mapStyles'; +import {\n buildBasemapStyle,\n CARTO_ATTRIBUTION_HTML,\n OPENFREEMAP_ATTRIBUTION_HTML,\n OSM_ATTRIBUTION_HTML,\n} from '@/components/map/styles/mapStyles'; import { useBasemapConfig } from '@/hooks/useBasemapConfig'; import maplibregl from 'maplibre-gl'; import { AlertTriangle, Radio, Activity, Play, Satellite, ExternalLink, Info } from 'lucide-react'; @@ -430,9 +430,8 @@ const MaplibreViewer = ({ const [mapReady, setMapReady] = useState(false); const { theme } = useTheme(); const { cartoApiKey, loaded: basemapConfigLoaded } = useBasemapConfig(); - const mapThemeStyle = useMemo( - () => - buildBasemapStyle(theme === 'light' ? 'light' : 'dark', cartoApiKey) as maplibregl.StyleSpecification, + const mapThemeStyle = useMemo( + () => buildBasemapStyle(theme === 'light' ? 'light' : 'dark', cartoApiKey), [theme, cartoApiKey], ); @@ -1901,8 +1900,8 @@ const MaplibreViewer = ({ className={`relative h-full w-full z-0 isolate ${selectedEntity && ['region_dossier', 'gdelt', 'liveuamap', 'news', 'telegram_osint', 'gt_risk'].includes(selectedEntity.type) ? 'map-focus-active' : ''}`} style={pinPlacementMode || sarAoiDropMode ? { cursor: 'crosshair' } : undefined} > - {/* Wait for /api/basemap-config so the first style load already carries the CARTO key. - Bounded: useBasemapConfig fails open to the unkeyed style after a short timeout. */} + {/* Resolve optional CARTO config before first paint. Without a CARTO key, + buildBasemapStyle uses the keyless OpenFreeMap style instead. */} {basemapConfigLoaded && ( © OpenStreetMap contributors', - 'CARTO', + OSM_ATTRIBUTION_HTML, + cartoApiKey ? CARTO_ATTRIBUTION_HTML : OPENFREEMAP_ATTRIBUTION_HTML, 'adsb.lol (ODbL)', 'OpenSky', 'CelesTrak', @@ -2045,7 +2044,6 @@ const MaplibreViewer = ({ Date: Tue, 6 Oct 2026 15:49:06 -0600 Subject: [PATCH 03/11] test(basemap): cover keyless default and CARTO override --- .../src/__tests__/map/basemapConfig.test.ts | 70 +++++++++++-------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/frontend/src/__tests__/map/basemapConfig.test.ts b/frontend/src/__tests__/map/basemapConfig.test.ts index 5d47c8ab..c2046f5f 100644 --- a/frontend/src/__tests__/map/basemapConfig.test.ts +++ b/frontend/src/__tests__/map/basemapConfig.test.ts @@ -5,6 +5,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { CARTO_ATTRIBUTION_HTML, + OPENFREEMAP_ATTRIBUTION_HTML, + OPENFREEMAP_STYLE_URLS, OSM_ATTRIBUTION_HTML, buildBasemapStyle, cartoTileUrls, @@ -24,57 +26,64 @@ const VIEWER_SRC = fs.readFileSync( ); describe('buildBasemapStyle', () => { - it('produces unkeyed CARTO tile URLs when no key is given', () => { - const style = buildBasemapStyle('dark'); - const source = style.sources['carto-dark']; + it('uses keyless OpenFreeMap styles when CARTO is not configured', () => { + expect(buildBasemapStyle('dark')).toBe(OPENFREEMAP_STYLE_URLS.dark); + expect(buildBasemapStyle('light')).toBe(OPENFREEMAP_STYLE_URLS.light); + expect(buildBasemapStyle('dark', ' ')).toBe(OPENFREEMAP_STYLE_URLS.dark); + }); + + it('keeps CARTO as the compatibility path when an operator configured a key', () => { + const style = buildBasemapStyle('light', 'my key'); + expect(typeof style).toBe('object'); + if (typeof style === 'string') throw new Error('expected CARTO style object'); + + const source = style.sources['carto-light']; expect(source.tiles).toHaveLength(4); for (const url of source.tiles) { - expect(url).toMatch(/^https:\/\/[abcd]\.basemaps\.cartocdn\.com\/rastertiles\/dark_all\//); - expect(url).not.toContain('?'); - } - expect(style.layers[0]).toMatchObject({ id: 'carto-dark-layer', source: 'carto-dark' }); - }); - - it('appends ?key= to every tile URL when a key is given', () => { - const style = buildBasemapStyle('light', 'my key'); - for (const url of style.sources['carto-light'].tiles) { expect(url).toMatch(/\/rastertiles\/light_all\/\{z\}\/\{x\}\/\{y\}@2x\.png\?key=my%20key$/); } + expect(style.layers[0]).toMatchObject({ id: 'carto-light-layer', source: 'carto-light' }); }); - it('treats blank keys as unconfigured', () => { - expect(cartoTileUrls('dark', ' ')).toEqual(cartoTileUrls('dark')); - expect(cartoTileUrls('dark', null)).toEqual(cartoTileUrls('dark')); + it('requires a non-empty CARTO key before building CARTO tile URLs', () => { + expect(cartoTileUrls('dark', 'my key')).toHaveLength(4); + expect(cartoTileUrls('dark', 'my key')[0]).toContain('?key=my%20key'); }); - it('keeps the key-less default exports in sync with the builder', () => { - expect(darkStyle).toEqual(buildBasemapStyle('dark')); - expect(lightStyle).toEqual(buildBasemapStyle('light')); + it('keeps the keyless default exports in sync with the builder', () => { + expect(darkStyle).toBe(OPENFREEMAP_STYLE_URLS.dark); + expect(lightStyle).toBe(OPENFREEMAP_STYLE_URLS.light); }); - it('declares OpenStreetMap and CARTO attribution on the raster source, keyed or not', () => { - for (const style of [buildBasemapStyle('dark'), buildBasemapStyle('light', 'k')]) { - const source = Object.values(style.sources)[0]; - expect(source.attribution).toContain('openstreetmap.org/copyright'); - expect(source.attribution).toContain('carto.com/attribution'); - } + it('keeps OpenStreetMap/CARTO attribution on the optional CARTO raster path', () => { + const style = buildBasemapStyle('dark', 'k'); + if (typeof style === 'string') throw new Error('expected CARTO style object'); + const source = Object.values(style.sources)[0]; + expect(source.attribution).toContain('openstreetmap.org/copyright'); + expect(source.attribution).toContain('carto.com/attribution'); }); }); describe('MaplibreViewer attribution and basemap gating', () => { - it('still renders the explicit AttributionControl with the same OSM/CARTO markup', () => { - // attributionControl={false} only disables the default control; the - // explicit child below it is the visible attribution and must survive. + it('renders OSM plus provider-specific attribution', () => { expect(VIEWER_SRC).toContain(' { + it('gates only long enough to resolve the optional CARTO override', () => { expect(VIEWER_SRC).toContain('{basemapConfigLoaded && ('); expect(VIEWER_SRC).toMatch(/const \{ cartoApiKey, loaded: basemapConfigLoaded \} = useBasemapConfig\(\)/); expect(BASEMAP_CONFIG_SOFT_TIMEOUT_MS).toBeLessThan(BASEMAP_CONFIG_HARD_TIMEOUT_MS); }); + + it('does not require the old CARTO-only imagery insertion anchor', () => { + expect(VIEWER_SRC).not.toContain('beforeId="imagery-ceiling"'); + }); }); describe('useBasemapConfig', () => { @@ -192,3 +201,4 @@ describe('useBasemapConfig', () => { expect(e.result.current).toEqual({ cartoApiKey: 'second-try', loaded: true }); }); }); + From 96930018d47734b34dd07714faf59a2a2631f1a3 Mon Sep 17 00:00:00 2001 From: Shadowbroker <43977454+BigBodyCobain@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:49:50 -0600 Subject: [PATCH 04/11] docs(basemap): describe CARTO as optional override --- backend/services/api_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/services/api_settings.py b/backend/services/api_settings.py index be65c7d7..e553468d 100644 --- a/backend/services/api_settings.py +++ b/backend/services/api_settings.py @@ -229,7 +229,7 @@ API_REGISTRY = [ "id": "carto_api_key", "env_key": "CARTO_API_KEY", "name": "CARTO Basemaps", - "description": "API key for the CARTO raster basemap behind the DEFAULT dark/light map. CARTO requires one; without it tiles still load but carry an \"API KEY REQUIRED\" watermark. Free at carto.com/basemaps/apikey (no CARTO account needed, 5M tiles/month). Unlike the other keys this one is sent to the browser (GET /api/basemap-config) because the browser passes it to CARTO on every tile request.", + "description": "Optional CARTO raster-basemap override. ShadowBroker defaults to the keyless OpenFreeMap dark/light styles when this is unset. When configured, the browser receives this key from GET /api/basemap-config and sends it to CARTO on tile requests.", "category": "Imagery", "url": "https://carto.com/basemaps/apikey", "required": False, From a0d8ed0b7c04b563d1ee6360d81925617181aca6 Mon Sep 17 00:00:00 2001 From: Shadowbroker <43977454+BigBodyCobain@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:49:53 -0600 Subject: [PATCH 05/11] docs(basemap): make zero-config provider explicit --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index fc868f05..5d2513c7 100644 --- a/.env.example +++ b/.env.example @@ -27,8 +27,8 @@ AIS_API_KEY= # Windy Webcams global CCTV layer — free key from https://api.windy.com/webcams/docs # WINDY_API_KEY= -# CARTO basemap tiles (DEFAULT map) — free key from https://carto.com/basemaps/apikey -# Without it tiles render with an "API KEY REQUIRED" watermark. +# Optional CARTO raster-basemap override — free key from https://carto.com/basemaps/apikey +# Leave unset for the zero-config OpenFreeMap dark/light basemap. # CARTO_API_KEY= # Telegram OSINT map layer — scrapes public t.me/s channel previews (no bot token). From f8b8b4141502a3c5633db7ec0e3614238515055b Mon Sep 17 00:00:00 2001 From: Shadowbroker <43977454+BigBodyCobain@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:49:56 -0600 Subject: [PATCH 06/11] docs(basemap): document keyless default map --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 36be9d06..c65282bc 100644 --- a/README.md +++ b/README.md @@ -354,7 +354,7 @@ Adapted from the [OSIRIS](https://github.com/simplifaisoul/osiris) recon stack ( * **Sentinel Hub Process API** — Copernicus CDSE satellite imagery with OAuth2 token flow (NEW) * **VIIRS Nightlights** — Night-time light change detection overlay (NEW) * **5 Visual Modes** — Toggle the entire map aesthetic via the STYLE button: - * **DEFAULT** — Dark CARTO basemap + * **DEFAULT** — Dark OpenFreeMap vector basemap (no API key required; optional CARTO override) * **SATELLITE** — Sub-meter Esri World Imagery * **FLIR** — Thermal imaging aesthetic (inverted greyscale) * **NVG** — Night vision green phosphor @@ -666,7 +666,7 @@ ShadowBroker v0.9.7 is composed of three vertically-stacked planes — the **Ope | [Wikidata SPARQL](https://query.wikidata.org) | Head of state data | On-demand (cached 24h) | No | | [Wikipedia API](https://en.wikipedia.org/api) | Location summaries & aircraft images | On-demand (cached) | No | | [OSM Nominatim](https://nominatim.openstreetmap.org) | Place name geocoding (LOCATE bar) | On-demand | No | -| [CARTO Basemaps](https://carto.com) | Dark/light map tiles | Continuous | **Yes** (free, `CARTO_API_KEY`) | +| [OpenFreeMap](https://openfreemap.org) | Default dark/light vector basemap | Continuous | No |\n| [CARTO Basemaps](https://carto.com) | Optional raster basemap override | Continuous | Optional (`CARTO_API_KEY`) | **Outbound privacy & audit (#348–#366):** Each self-hosted install uses its own backend IP and per-install User-Agent handle. See [docs/OUTBOUND_DATA.md](docs/OUTBOUND_DATA.md) for what contacts third parties, opt-in/env controls, and accepted tradeoffs (CCTV Referer, basemap CDN, LiveUAMap, etc.). @@ -1130,7 +1130,7 @@ OPENSKY_CLIENT_SECRET=your_opensky_secret # OAuth2 — paired with Client ID # Optional (enhances data quality) AIS_API_KEY=your_aisstream_key # Maritime vessel tracking (aisstream.io) — ships layer empty without it LTA_ACCOUNT_KEY=your_lta_key # Singapore CCTV cameras -CARTO_API_KEY=your_carto_key # CARTO basemap tiles — DEFAULT map shows an "API KEY REQUIRED" watermark without it (free: carto.com/basemaps/apikey) +CARTO_API_KEY=your_carto_key # Optional CARTO raster-basemap override; DEFAULT uses keyless OpenFreeMap when unset SHODAN_API_KEY=your_shodan_key # Shodan device search overlay SH_CLIENT_ID=your_sentinel_hub_id # Copernicus CDSE Sentinel Hub imagery SH_CLIENT_SECRET=your_sentinel_hub_secret # Paired with Sentinel Hub Client ID From d549b9d4dd6d152aba70868fa262af284b3d57b0 Mon Sep 17 00:00:00 2001 From: Shadowbroker <43977454+BigBodyCobain@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:49:59 -0600 Subject: [PATCH 07/11] docs(basemap): record OpenFreeMap default and CARTO override --- docs/OUTBOUND_DATA.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/OUTBOUND_DATA.md b/docs/OUTBOUND_DATA.md index ab96f08d..0142bafa 100644 --- a/docs/OUTBOUND_DATA.md +++ b/docs/OUTBOUND_DATA.md @@ -78,13 +78,15 @@ Shadowbroker is **self-hosted**: each install uses its own backend egress IP. Th --- -## Basemap CDN (#354) +## Basemap CDN (#354, #583) -- **Code:** `frontend/src/components/map/styles/mapStyles.ts`, `frontend/public/map-style.json` -- **Hosts:** `*.basemaps.cartocdn.com`, `demotiles.maplibre.org` -- **Exposure:** **Browser** loads tiles (client IP + pan/zoom), not the backend -- **API key:** CARTO requires a key for basemap tiles. `CARTO_API_KEY` lives with the other backend keys (env or the API Keys panel) and is served to the browser by the public backend route `GET /api/basemap-config` through the normal same-origin `/api/*` path (Next.js proxy in web mode, companion server in packaged desktop). The browser then sends it to `*.basemaps.cartocdn.com` as a `?key=` query parameter on every tile request, so it is not treated as a secret. Unset it to keep the previous unkeyed behavior (watermarked tiles). -- **Mitigation:** Self-host raster tiles and point MapLibre `sources` at your tile server (operator choice; not required for core features) +- **Code:** `frontend/src/components/map/styles/mapStyles.ts` +- **Default host:** `tiles.openfreemap.org` +- **Default behavior:** OpenFreeMap Dark/Positron vector styles load without registration or an API key. OpenFreeMap's public instance is the zero-config path. +- **Optional CARTO override:** If `CARTO_API_KEY` is configured (env or API Keys panel), ShadowBroker keeps the existing CARTO raster dark/light basemap. The key is served by `GET /api/basemap-config` and sent by the browser to `*.basemaps.cartocdn.com`. +- **Exposure:** Basemap requests are made by the **browser**, so the selected provider sees browser network metadata and requested map resources. +- **Attribution:** ShadowBroker explicitly displays OpenStreetMap plus the active basemap provider attribution. +- **Self-hosting:** OpenFreeMap is open-source and supports self-hosting; operators can replace the public basemap endpoint if they need full infrastructure control. --- From bb369099b77b08d2fd4b12cefa8a96d6aa2da129 Mon Sep 17 00:00:00 2001 From: Shadowbroker <43977454+BigBodyCobain@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:50:01 -0600 Subject: [PATCH 08/11] docs(basemap): update provider attribution --- DATA-ATTRIBUTION.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DATA-ATTRIBUTION.md b/DATA-ATTRIBUTION.md index 9e8ea906..66c64ff3 100644 --- a/DATA-ATTRIBUTION.md +++ b/DATA-ATTRIBUTION.md @@ -19,7 +19,7 @@ derivative must also be offered under ODbL and must preserve attribution. | Source | URL | What we use it for | |---|---|---| | adsb.lol | https://adsb.lol | Military aircraft positions, regional commercial gap-fill, route enrichment | -| OpenStreetMap contributors | https://www.openstreetmap.org/copyright | Nominatim geocoding (LOCATE bar), CARTO basemap tiles (OSM-derived) | +| OpenStreetMap contributors | https://www.openstreetmap.org/copyright | Nominatim geocoding (LOCATE bar), OpenFreeMap/CARTO basemap data (OSM-derived) | **Attribution requirement:** the ShadowBroker map UI displays "© OpenStreetMap contributors" and "adsb.lol (ODbL)" in the map attribution @@ -59,7 +59,7 @@ These sources have their own terms; consult each link before redistributing. | Meshtastic | https://meshtastic.org | Open Source | Mesh radio nodes (protocol) | | Meshtastic Map (Liam Cottle) | https://meshtastic.liamcottle.net | Community project (per-site terms) | Global Meshtastic node positions — polled once per day with on-disk cache trust to minimize load on this volunteer-run HTTP API | | APRS-IS | https://www.aprs-is.net | Open / attribution-based | Amateur radio positions | -| CARTO basemaps | https://carto.com | CARTO attribution required | Dark map tiles (OSM-derived) | +| OpenFreeMap / OpenMapTiles | https://openfreemap.org | OSM/OpenMapTiles attribution | Default dark/light vector basemap |\n| CARTO basemaps | https://carto.com | CARTO attribution required | Optional keyed raster basemap override | | Esri World Imagery | https://www.arcgis.com | Esri terms | High-res satellite basemap | | IODA (Georgia Tech) | https://ioda.inetintel.cc.gatech.edu | Research/academic terms | Internet outage data | From b6d3c20690e46609fda331f2e082fb98f1392651 Mon Sep 17 00:00:00 2001 From: Shadowbroker <43977454+BigBodyCobain@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:50:21 -0600 Subject: [PATCH 09/11] fix(basemap): type provider style union --- frontend/src/components/map/styles/mapStyles.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/map/styles/mapStyles.ts b/frontend/src/components/map/styles/mapStyles.ts index d4916429..7ee421d2 100644 --- a/frontend/src/components/map/styles/mapStyles.ts +++ b/frontend/src/components/map/styles/mapStyles.ts @@ -1,3 +1,5 @@ +import type { StyleSpecification } from 'maplibre-gl'; + /** * ShadowBroker's zero-config basemap uses OpenFreeMap vector styles. * Operators who configure CARTO_API_KEY keep the existing CARTO raster @@ -39,7 +41,7 @@ export function cartoTileUrls(theme: BasemapTheme, cartoApiKey: string): string[ * Use OpenFreeMap by default. CARTO is retained as an opt-in compatibility * path when an operator has already configured CARTO_API_KEY. */ -export function buildBasemapStyle(theme: BasemapTheme, cartoApiKey?: string | null) { +export function buildBasemapStyle(\n theme: BasemapTheme,\n cartoApiKey?: string | null,\n): string | StyleSpecification { const key = (cartoApiKey || '').trim(); if (!key) return OPENFREEMAP_STYLE_URLS[theme]; From 951c776ec0926705d9ab384411719a68d81aac2f Mon Sep 17 00:00:00 2001 From: Shadowbroker <43977454+BigBodyCobain@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:52:16 -0600 Subject: [PATCH 10/11] fix(basemap): correct viewer import formatting --- frontend/src/components/MaplibreViewer.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/MaplibreViewer.tsx b/frontend/src/components/MaplibreViewer.tsx index 408a072c..e525676d 100644 --- a/frontend/src/components/MaplibreViewer.tsx +++ b/frontend/src/components/MaplibreViewer.tsx @@ -15,7 +15,12 @@ import Map, { } from 'react-map-gl/maplibre'; import 'maplibre-gl/dist/maplibre-gl.css'; import { computeNightPolygon } from '@/utils/solarTerminator'; -import {\n buildBasemapStyle,\n CARTO_ATTRIBUTION_HTML,\n OPENFREEMAP_ATTRIBUTION_HTML,\n OSM_ATTRIBUTION_HTML,\n} from '@/components/map/styles/mapStyles'; +import { + buildBasemapStyle, + CARTO_ATTRIBUTION_HTML, + OPENFREEMAP_ATTRIBUTION_HTML, + OSM_ATTRIBUTION_HTML, +} from '@/components/map/styles/mapStyles'; import { useBasemapConfig } from '@/hooks/useBasemapConfig'; import maplibregl from 'maplibre-gl'; import { AlertTriangle, Radio, Activity, Play, Satellite, ExternalLink, Info } from 'lucide-react'; From f282f8e2bb284988b87fe3cc148c8448272f4aa9 Mon Sep 17 00:00:00 2001 From: Shadowbroker <43977454+BigBodyCobain@users.noreply.github.com> Date: Tue, 6 Oct 2026 15:52:18 -0600 Subject: [PATCH 11/11] fix(basemap): correct style builder formatting --- frontend/src/components/map/styles/mapStyles.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/map/styles/mapStyles.ts b/frontend/src/components/map/styles/mapStyles.ts index 7ee421d2..56601195 100644 --- a/frontend/src/components/map/styles/mapStyles.ts +++ b/frontend/src/components/map/styles/mapStyles.ts @@ -41,7 +41,10 @@ export function cartoTileUrls(theme: BasemapTheme, cartoApiKey: string): string[ * Use OpenFreeMap by default. CARTO is retained as an opt-in compatibility * path when an operator has already configured CARTO_API_KEY. */ -export function buildBasemapStyle(\n theme: BasemapTheme,\n cartoApiKey?: string | null,\n): string | StyleSpecification { +export function buildBasemapStyle( + theme: BasemapTheme, + cartoApiKey?: string | null, +): string | StyleSpecification { const key = (cartoApiKey || '').trim(); if (!key) return OPENFREEMAP_STYLE_URLS[theme];