use std::collections::HashMap;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[derive(Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Layer {
pub minzoom: u8,
pub maxzoom: u8,
}
#[derive(Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Settings {
pub minzoom: u8,
pub maxzoom: u8,
pub basezoom: u8,
pub include_ids: bool,
pub compress: String,
pub name: String,
pub version: String,
pub description: String,
}
#[derive(Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Config {
pub layers: HashMap<String, Layer>,
pub settings: Settings,
}
#[cfg(feature = "serde")]
impl Config {
pub fn from_json(json_str: &str) -> Result<Self, serde_json::Error> {
serde_json::from_str(json_str)
}
}