combine martin endpoints#3

This commit is contained in:
Shautvast 2026-04-04 15:41:12 +02:00
parent 8da55ba5ef
commit 3feefd128d

View file

@ -29,7 +29,13 @@ impl MartinService {
x: u32, x: u32,
y: u32, y: u32,
) -> Result<(Bytes, Option<String>), AppError> { ) -> Result<(Bytes, Option<String>), AppError> {
let url = format!("{}/{layer}/{z}/{x}/{y}", self.base_url); // Martin serves composite tiles via comma-separated source names in the URL.
let martin_layer = if layer == "osm_all" {
"planet_osm_polygon,planet_osm_line,planet_osm_point,planet_osm_roads"
} else {
layer
};
let url = format!("{}/{martin_layer}/{z}/{x}/{y}", self.base_url);
let resp = self.client.get(&url).send().await.map_err(|e| { let resp = self.client.get(&url).send().await.map_err(|e| {
tracing::error!(error = %e, "Martin connection error"); tracing::error!(error = %e, "Martin connection error");
AppError::ServiceUnavailable("Martin tile server is unreachable".into()) AppError::ServiceUnavailable("Martin tile server is unreachable".into())