mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-08-26 17:31:37 +00:00
Merge pull request #8 from zvx-echo6/feat/vehicle-skip-gate
fix(navi): vehicle skips off-network gate; boundary chips show for non-Drive
This commit is contained in:
commit
0d503bb4c8
2 changed files with 14 additions and 2 deletions
|
|
@ -543,6 +543,17 @@ class OffrouteRouter:
|
||||||
if mode not in MODE_TO_COSTING:
|
if mode not in MODE_TO_COSTING:
|
||||||
return {"status": "error", "message": f"Unknown mode: {mode}"}
|
return {"status": "error", "message": f"Unknown mode: {mode}"}
|
||||||
|
|
||||||
|
# Vehicle is pure Valhalla road routing: Valhalla snaps endpoints to the
|
||||||
|
# nearest road automatically, so the off-network classifier is irrelevant
|
||||||
|
# (and a tight threshold would wrongly push normal road routes into
|
||||||
|
# wilderness pathfinding). Foot/MTB/ATV still use the threshold gate so
|
||||||
|
# users can intentionally pin backcountry points. Auto inherits this via
|
||||||
|
# its recursive self.route(..., mode="vehicle", ...) probe.
|
||||||
|
if mode == "vehicle":
|
||||||
|
return self._route_D_network_only(
|
||||||
|
start_lat, start_lon, end_lat, end_lon, mode
|
||||||
|
)
|
||||||
|
|
||||||
# Detect network status for both endpoints
|
# Detect network status for both endpoints
|
||||||
start_status = self._locate_on_network(start_lat, start_lon, mode)
|
start_status = self._locate_on_network(start_lat, start_lon, mode)
|
||||||
end_status = self._locate_on_network(end_lat, end_lon, mode)
|
end_status = self._locate_on_network(end_lat, end_lon, mode)
|
||||||
|
|
|
||||||
|
|
@ -325,8 +325,9 @@ export default function DirectionsPanel({ onClose }) {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Boundary mode selector (only for non-auto modes) */}
|
{/* Boundary mode selector — hidden only for Drive (vehicle), which is pure
|
||||||
{routeMode !== "auto" && (
|
Valhalla road routing; Auto/Foot/MTB/ATV may traverse wilderness. */}
|
||||||
|
{routeMode !== "vehicle" && (
|
||||||
<div className="flex gap-1">
|
<div className="flex gap-1">
|
||||||
{BOUNDARY_MODES.map((m) => {
|
{BOUNDARY_MODES.map((m) => {
|
||||||
const active = boundaryMode === m.id
|
const active = boundaryMode === m.id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue