Created
May 9, 2024 17:00
-
-
Save joaofig/3bdf69ceff490b76c9e5d0b1e1cff0df to your computer and use it in GitHub Desktop.
The main entry point to the density tile server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[get("/density/<x>/<y>/<z>")] | |
async fn get_density_tile(x: i32, y: i32, z: i32) -> Result<NamedFile> { | |
let file_name = if !(1..=18).contains(&z) { | |
get_default_filename() | |
} else { | |
get_tile_file_name(x, y, z).await | |
}; | |
NamedFile::open(PathBuf::from(file_name)).await | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment