This commit is contained in:
Dongho Kim
2025-12-19 02:24:05 +09:00
parent 1dcdce3ef1
commit 136723ca24
20 changed files with 1422 additions and 603 deletions

View File

@@ -13,13 +13,14 @@ pub struct MapNode {
pub tags: HashMap<String, String>,
}
/// A map way (line/polygon feature with tags and geometry)
///A map way (line/polygon feature with tags and geometry)
#[allow(dead_code)]
#[derive(Deserialize, Debug, Clone)]
pub struct MapWay {
pub id: i64,
pub tags: HashMap<String, String>,
pub points: Vec<u8>,
pub vertex_buffer: Vec<u8>, // Precomputed GPU-ready vertex data
}
/// Combined tile data from the backend
@@ -66,3 +67,26 @@ pub struct TileBuffers {
pub water_line_vertex_buffer: wgpu::Buffer,
pub water_line_vertex_count: u32,
}
/// Type of label for styling
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum LabelType {
Country,
City,
Street,
Poi,
Transit, // S-Bahn/U-Bahn line labels (S1, U3, etc.)
}
/// Pre-computed label data to avoid processing tags every frame
#[derive(Clone, Debug)]
pub struct CachedLabel {
pub name: String,
pub lat: f64,
pub lon: f64,
pub label_type: LabelType,
pub rotation: f64,
pub priority: i32,
pub min_zoom: f64,
pub category: String, // CSS class suffix
}