@mytec: iter2.4 ready for testing

This commit is contained in:
2026-02-01 10:48:23 +02:00
parent 7893c57bc9
commit 5488633e43
19 changed files with 1448 additions and 69 deletions

View File

@@ -97,6 +97,22 @@ export interface Preset {
estimated_speed: string;
}
// === Elevation grid types ===
export interface ElevationGridResponse {
grid: number[][];
rows: number;
cols: number;
min_elevation: number;
max_elevation: number;
bbox: {
min_lat: number;
max_lat: number;
min_lon: number;
max_lon: number;
};
}
// === API Client ===
class ApiService {
@@ -148,6 +164,27 @@ class ApiService {
return data.elevation;
}
async getElevationGrid(
minLat: number,
maxLat: number,
minLon: number,
maxLon: number,
resolution: number = 100,
): Promise<ElevationGridResponse> {
const params = new URLSearchParams({
min_lat: minLat.toString(),
max_lat: maxLat.toString(),
min_lon: minLon.toString(),
max_lon: maxLon.toString(),
resolution: resolution.toString(),
});
const response = await fetch(
`${API_BASE}/api/terrain/elevation-grid?${params}`
);
if (!response.ok) throw new Error('Failed to fetch elevation grid');
return response.json();
}
// === Region / Caching API ===
async getRegions(): Promise<RegionInfo[]> {