Offline hiking trails drawn only from zoom 10 (a whole country's lanes rebuilt per zoom froze the zoomed-out map); TODO: server in the car (RPi CM5) — builds on brick, offline login, HTTPS, Pi kiosk display, home ⇄ car sync with conflict handling, hardware buttons over CAN
This commit is contained in:
1 parent
2470099877
commit
fdd77986c1
2 files changed
+52
-5
No files matched your search
@@ -62,6 +62,9 @@ const OPACITY = 0.85;
|
||||
// 3D terrain (sinks under raised ground, warns on the console) — a known
|
||||
// limitation of the library, not worth working around for an overlay.
|
||||
const LANES_LAYER_ID = "hiking-trails-lanes";
|
||||
// Zoomed out further, a whole country's lanes took seconds per frame/zoom
|
||||
// build and froze the map — and a trail line at that scale tells nothing.
|
||||
const LANES_MIN_ZOOM = 10;
|
||||
const LANE_SIZES = () => ({ spacing: 3.5, width: 3, casingWidth: 0.5 });
|
||||
function offlineUrl(code) {
|
||||
return `/tiles/hiking_trails/${code}.geojson`;
|
||||
@@ -332,6 +335,7 @@ export class HikingTrailsControl {
|
||||
// Below labels (same firstSymbolLayerId spot contour.js/radar.js use),
|
||||
// so place names/POI icons stay readable on top of the trail lines.
|
||||
this._map.addLayer(this._lanes, firstSymbolLayerId(this._map));
|
||||
this._map.setLayerZoomRange(LANES_LAYER_ID, LANES_MIN_ZOOM, 24);
|
||||
}
|
||||
|
||||
_handleClick(event) {
|
||||
@@ -345,7 +349,7 @@ export class HikingTrailsControl {
|
||||
// miss just closes an already-open panel rather than showing a "not
|
||||
// found" message, same as clicking empty space anywhere else on the map.
|
||||
_handleOfflineClick(event) {
|
||||
const hit = this._lanes?.queryLane(event.point, 8);
|
||||
const hit = this._map.getZoom() >= LANES_MIN_ZOOM && this._lanes?.queryLane(event.point, 8);
|
||||
const info = hit && this._routeInfo.get(String(hit.route));
|
||||
if (!info) {
|
||||
this._hidePanel();
|
||||
|
||||
Reference in new issue
Block a user