From 9059551a558ac850821adc002a74bdc69bbd9a51 Mon Sep 17 00:00:00 2001 From: Stepan Kuzmin Date: Thu, 25 Jan 2018 11:09:17 +0300 Subject: [PATCH] use tileset id as name --- src/martin/routes.rs | 2 +- src/martin/tileset.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/martin/routes.rs b/src/martin/routes.rs index 5f1d5b33..a8fe122b 100644 --- a/src/martin/routes.rs +++ b/src/martin/routes.rs @@ -55,7 +55,7 @@ pub fn tileset(req: &mut Request, caps: Captures) -> IronResult { let mut tilejson_builder = TileJSONBuilder::new(); tilejson_builder.scheme("tms"); - tilejson_builder.name(&tileset.table); + tilejson_builder.name(&tileset.id); tilejson_builder.tiles(vec![&tiles_url]); let tilejson = tilejson_builder.finalize(); diff --git a/src/martin/tileset.rs b/src/martin/tileset.rs index 03e22a3d..462393c7 100644 --- a/src/martin/tileset.rs +++ b/src/martin/tileset.rs @@ -7,6 +7,7 @@ use super::db::PostgresConnection; #[derive(Serialize, Debug)] pub struct Tileset { + pub id: String, schema: String, pub table: String, geometry_column: String, @@ -92,6 +93,7 @@ pub fn get_tilesets(conn: PostgresConnection) -> Result let srid: i32 = row.get("srid"); let tileset = Tileset { + id: id.to_string(), schema: schema, table: table, geometry_column: geometry_column,