use tileset id as name

This commit is contained in:
Stepan Kuzmin 2018-01-25 11:09:17 +03:00
parent c8d46d398a
commit 9059551a55
2 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,7 @@ pub fn tileset(req: &mut Request, caps: Captures) -> IronResult<Response> {
let mut tilejson_builder = TileJSONBuilder::new(); let mut tilejson_builder = TileJSONBuilder::new();
tilejson_builder.scheme("tms"); tilejson_builder.scheme("tms");
tilejson_builder.name(&tileset.table); tilejson_builder.name(&tileset.id);
tilejson_builder.tiles(vec![&tiles_url]); tilejson_builder.tiles(vec![&tiles_url]);
let tilejson = tilejson_builder.finalize(); let tilejson = tilejson_builder.finalize();

View File

@ -7,6 +7,7 @@ use super::db::PostgresConnection;
#[derive(Serialize, Debug)] #[derive(Serialize, Debug)]
pub struct Tileset { pub struct Tileset {
pub id: String,
schema: String, schema: String,
pub table: String, pub table: String,
geometry_column: String, geometry_column: String,
@ -92,6 +93,7 @@ pub fn get_tilesets(conn: PostgresConnection) -> Result<HashMap<String, Tileset>
let srid: i32 = row.get("srid"); let srid: i32 = row.get("srid");
let tileset = Tileset { let tileset = Tileset {
id: id.to_string(),
schema: schema, schema: schema,
table: table, table: table,
geometry_column: geometry_column, geometry_column: geometry_column,