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
@@ -180,6 +180,14 @@ export class HikingTrailsControl {
|
||||
});
|
||||
}
|
||||
|
||||
// Search box (search.js) picked a trail from a country that isn't ticked.
|
||||
showCountry(code) {
|
||||
const input = [...this._countryList.querySelectorAll("input")].find((el) => el.value === code);
|
||||
if (!input || input.checked) return;
|
||||
input.checked = true;
|
||||
this._toggleCountry(code, true);
|
||||
}
|
||||
|
||||
_toggleOnline(active) {
|
||||
this._active = active;
|
||||
if (active) this._addOnlineLayer();
|
||||
|
||||
Reference in new issue
Block a user