mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-03 05:09:58 -05:00
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:
parent
0a5fe7eebe
commit
b8a532c8d9
102 changed files with 5033 additions and 2712 deletions
|
|
@ -325,6 +325,31 @@ export function useSearchSuggestions(defaultSearchStr, defaultTagNames, anyTag)
|
|||
results.apps = {name: 'Apps', results: matchingApps.slice(0, 5)};
|
||||
}
|
||||
|
||||
// Detect coordinates (e.g., "40.76, -111.89" or "40.76 -111.89").
|
||||
const coordMatch = searchStr && searchStr.trim().match(
|
||||
/^(-?\d+\.?\d*)[,\s]+(-?\d+\.?\d*)$/
|
||||
);
|
||||
if (coordMatch) {
|
||||
const lat = parseFloat(coordMatch[1]);
|
||||
const lon = parseFloat(coordMatch[2]);
|
||||
if (lat >= -90 && lat <= 90 && lon >= -180 && lon <= 180) {
|
||||
// Derive zoom from decimal precision: 0dp=3, 1dp=7, 2dp=10, 3dp=13, 4dp=16, 5+=18
|
||||
const maxDecimals = Math.max(
|
||||
(coordMatch[1].split('.')[1] || '').length,
|
||||
(coordMatch[2].split('.')[1] || '').length,
|
||||
);
|
||||
const zoom = Math.min([3, 7, 10, 13, 16, 18][maxDecimals] || 18, 18);
|
||||
results.map = {
|
||||
name: 'Map', results: [{
|
||||
type: 'map',
|
||||
title: `${lat}, ${lon}`,
|
||||
description: 'View on map',
|
||||
location: `/map?lat=${lat}&lon=${lon}&z=${zoom}`,
|
||||
}]
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
setSuggestionsResults(results);
|
||||
setSuggestionsSums({
|
||||
fileGroups: newSuggestions.fileGroups,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue