Key changes:

- Add MapLibre GL JS viewer with light/dark themes, terrain layer,
  and embedded static map page for coordinate sharing
- Add map pin support with persistent map_pins.yaml config
- Add map region subscriptions and downloader with progress tracking,
  sourcing pre-extracted PMTiles from a cold CDN
- Add map export to PNG and GPS coordinate copy via context menu
- Add MapViewer React component alongside reworked Map page
- Add map catalog and region-building script (build_map_regions.py)
- Remove OSM import/render scripts, leaflet files, Apache configs,
  renderd service, and osm-map-dumper Docker container
- Update Caddyfile to serve PMTiles and map static assets
- Update build/install/repair scripts for Protomaps dependencies
- Drop map_file table, add/drop map_subscription table (alembic)
- Adding button to skip primary drive mounting during onboarding.
This commit is contained in:
Roland 2026-03-29 18:58:31 -06:00
parent 0a5fe7eebe
commit b8a532c8d9
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
102 changed files with 5033 additions and 2712 deletions

View file

@ -1485,21 +1485,85 @@ export async function setThrottle(on) {
}
}
export async function getMapImportStatus() {
export async function getMapFiles() {
const response = await apiGet(`${API_URI}/map/files`);
if (response.ok) {
return await response.json();
} else {
const message = await getErrorMessage(response, 'Could not get import status');
const message = await getErrorMessage(response, 'Could not get map files');
toast({type: 'error', title: 'Map Error', description: message, time: 5000});
}
}
export async function importMapFiles(paths) {
let body = {'files': paths};
const response = await apiPost(`${API_URI}/map/import`, body);
export async function deleteMapFile(filename) {
const response = await apiDelete(`${API_URI}/map/files/${encodeURIComponent(filename)}`);
if (!response.ok) {
const message = await getErrorMessage(response, 'Could not start import! See server logs.');
const message = await getErrorMessage(response, 'Could not delete map file');
toast({type: 'error', title: 'Map Error', description: message, time: 5000});
}
}
export async function fetchMapSubscriptions() {
const response = await apiGet(`${API_URI}/map/subscribe`);
if (response.ok) {
return await response.json();
} else {
const message = await getErrorMessage(response, 'Could not get map subscriptions');
toast({type: 'error', title: 'Map Error', description: message, time: 5000});
}
}
export async function mapSubscribe(name, region) {
const body = {name, region};
const response = await apiPost(`${API_URI}/map/subscribe`, body);
if (response.ok) {
return true;
} else {
const message = await getErrorMessage(response, 'Could not subscribe to map region');
toast({type: 'error', title: 'Map Error', description: message, time: 5000});
return false;
}
}
export async function mapUnsubscribe(region) {
const response = await apiDelete(`${API_URI}/map/subscribe/${encodeURIComponent(region)}`);
if (!response.ok) {
const message = await getErrorMessage(response, 'Could not unsubscribe from map region');
toast({type: 'error', title: 'Map Error', description: message, time: 5000});
}
}
export async function getMapPins() {
const response = await apiGet(`${API_URI}/map/pins`);
if (response.ok) {
return await response.json();
}
}
export async function addMapPin(lat, lon, label, color) {
const body = {lat, lon, label, color};
const response = await apiPost(`${API_URI}/map/pins`, body);
if (response.ok) {
return await response.json();
} else {
const message = await getErrorMessage(response, 'Could not add map pin');
toast({type: 'error', title: 'Map Error', description: message, time: 5000});
}
}
export async function deleteMapPin(pinId) {
const response = await apiDelete(`${API_URI}/map/pins/${pinId}`);
if (!response.ok) {
const message = await getErrorMessage(response, 'Could not delete map pin');
toast({type: 'error', title: 'Map Error', description: message, time: 5000});
}
}
export async function updateMapPin(pinId, label, color) {
const body = {label, color};
const response = await apiPut(`${API_URI}/map/pins/${pinId}`, body);
if (!response.ok) {
const message = await getErrorMessage(response, 'Could not update map pin');
toast({type: 'error', title: 'Map Error', description: message, time: 5000});
}
}