Skip to content

Instantly share code, notes, and snippets.

@joaofig
Created May 9, 2024 17:00
Show Gist options
  • Save joaofig/3bdf69ceff490b76c9e5d0b1e1cff0df to your computer and use it in GitHub Desktop.
Save joaofig/3bdf69ceff490b76c9e5d0b1e1cff0df to your computer and use it in GitHub Desktop.
The main entry point to the density tile server
#[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