From 0698373151c651711b4927e9513a54ef04e84fe5 Mon Sep 17 00:00:00 2001 From: Nicholas Orlowsky Date: Tue, 14 Apr 2026 22:06:28 -0400 Subject: [PATCH] basic map --- web/src/controllers/mod.rs | 1 + web/src/main.rs | 1 + web/src/templates.rs | 6 ++++++ web/templates/layout.html | 1 + 4 files changed, 9 insertions(+) diff --git a/web/src/controllers/mod.rs b/web/src/controllers/mod.rs index 5b25864..586664e 100644 --- a/web/src/controllers/mod.rs +++ b/web/src/controllers/mod.rs @@ -1,3 +1,4 @@ pub mod index; pub mod route; pub mod stop; +pub mod map; diff --git a/web/src/main.rs b/web/src/main.rs index fe13eb5..a42266b 100644 --- a/web/src/main.rs +++ b/web/src/main.rs @@ -57,6 +57,7 @@ async fn main() -> ::anyhow::Result<()> { .service(controllers::stop::search_stops_html) .service(controllers::stop::get_stop_table_html) .service(controllers::index::get_index_html) + .service(controllers::map::get_map_element_html) .service(actix_files::Files::new("/assets", "./assets")) }) .bind(("0.0.0.0", 8080))? diff --git a/web/src/templates.rs b/web/src/templates.rs index a0d73a9..f08fbca 100644 --- a/web/src/templates.rs +++ b/web/src/templates.rs @@ -99,6 +99,12 @@ pub struct StopSearchResults { pub results: Vec } +#[derive(askama::Template)] +#[template(path = "map.html")] +pub struct MapTemplate { + pub locations: Vec<(f64,f64, String)> +} + pub fn build_timetables(directions: Vec, trips: Vec) -> Vec { let mut results = Vec::new(); diff --git a/web/templates/layout.html b/web/templates/layout.html index bd97b76..cf745fc 100644 --- a/web/templates/layout.html +++ b/web/templates/layout.html @@ -59,6 +59,7 @@ window.onload = function () { [ Home ] [ Routes ] [ Stops ] + [ Map ]