Search: look through all saved layers and offline hiking trails
GET /api/search (lib/maptool/search.rb) matches feature name and description, case- and diacritics-insensitive, across every file in Tracks & Points (shown or not) and every offline hiking-trails country. Parsed features are cached in memory per file by mtime. The search box now queries local sources and Nominatim side by side, labels each result with where it was found, lets you untick sources, and switches a result's layer on if it was off before zooming to it.
This commit is contained in:
1 parent
2611713489
commit
0051a0337c
10 files changed
+316
-21
No files matched your search
@@ -59,6 +59,16 @@ independence from connectivity.
|
||||
** [x] Fixed: the Unigrid Matrix category filter only re-sliced the *points* source (`_applyCategoryFilter`) — toggling the "Note" category off hid point notes but not polygon/line ones sharing that category. `_linesByPath` now tracks those alongside `_pointsByPath`, re-sliced/scanned the same way
|
||||
* [ ] Offline satellite tile caching (e.g. ESRI) for a selected route area — key for judging surface quality and obstacles when wild camping
|
||||
|
||||
== Search
|
||||
|
||||
* [ ] Unified search box — one query across every data source, not just what's currently on the map. `GET /api/search` (`lib/maptool/search.rb`) for local sources, online ones queried from the browser (`public/js/search.js`)
|
||||
** [x] Every layer under Tracks & Points (GPX, FIT, GeoJSON, notes, plugin output) and offline hiking trails — shown *and* hidden ones. Matches name + description, case/diacritics-insensitive ("kosice" finds "Košice"); parsed features cached in memory per file by mtime
|
||||
** [ ] Offline vector data — `offline.pmtiles` is tiles, not searchable by name; extract named places/POIs from the same Geofabrik `.osm.pbf` with `osmium tags-filter` during the offline build (same pattern as `HikingTrails`) into a per-country index, then one more key in `Search::SOURCES`. Probably needs SQLite FTS5 (`sqlite3` gem) at that size instead of the in-memory scan
|
||||
** [x] Every result shows where it was found (layer file / "Hiking trails SK" / "Online · Nominatim"); clicking one zooms to it (fitBounds for a track) and switches its layer on if it was off
|
||||
** [x] Source checklist in the search panel (all on by default), re-runs the search on change
|
||||
** [x] Online sources pluggable — one more entry in search.js's `SOURCES`; Nominatim already in, its failure only adds a "no connection" line under the local results
|
||||
** [ ] Kiwix as a source (its geo/full-text search already backs `GET /api/kiwix/nearby`)
|
||||
|
||||
== Nice to have (later)
|
||||
|
||||
Deprioritized for now — revisit after the sections above land.
|
||||
|
||||
Reference in new issue
Block a user