Format
This commit is contained in:
parent
77e01776f5
commit
a9717d570d
5 changed files with 28 additions and 10 deletions
|
|
@ -35,7 +35,7 @@ pub enum FeatureInfo {
|
|||
#[derive(Clone, Serialize)]
|
||||
pub struct FeatureGroupResponse {
|
||||
name: String,
|
||||
features: Vec<FeatureInfo>,
|
||||
pub(crate) features: Vec<FeatureInfo>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
|
|
|
|||
|
|
@ -89,9 +89,13 @@ pub async fn get_style(
|
|||
|
||||
fn build_style(is_dark: bool, layers: &[serde_json::Value], tile_url: &str) -> serde_json::Value {
|
||||
let (bg_color, water_color, land_color, road_color, text_color, text_halo) = if is_dark {
|
||||
("#1a1a1a", "#193447", "#1a1a1a", "#2a2a2a", "#888888", "#000000")
|
||||
(
|
||||
"#1a1a1a", "#193447", "#1a1a1a", "#2a2a2a", "#888888", "#000000",
|
||||
)
|
||||
} else {
|
||||
("#f8f4f0", "#aad3df", "#f8f4f0", "#ffffff", "#333333", "#ffffff")
|
||||
(
|
||||
"#f8f4f0", "#aad3df", "#f8f4f0", "#ffffff", "#333333", "#ffffff",
|
||||
)
|
||||
};
|
||||
|
||||
// Build layer list from metadata
|
||||
|
|
@ -238,7 +242,7 @@ fn build_style(is_dark: bool, layers: &[serde_json::Value], tile_url: &str) -> s
|
|||
serde_json::json!({
|
||||
"version": 8,
|
||||
"name": if is_dark { "Dark" } else { "Light" },
|
||||
"glyphs": "https://protomaps.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf",
|
||||
"glyphs": "/assets/fonts/{fontstack}/{range}.pbf",
|
||||
"sources": {
|
||||
"protomaps": {
|
||||
"type": "vector",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue