Rename layer

This commit is contained in:
Maximilian Ammann 2022-03-15 12:05:41 +01:00
parent 716cafe8de
commit 1a7512aa2a
2 changed files with 7 additions and 7 deletions

View File

@ -37,7 +37,7 @@ pub enum LayerPaint {
}
#[derive(Serialize, Deserialize, Debug)]
pub struct Layer {
pub struct StyleLayer {
pub id: String,
#[serde(rename = "type")]
pub typ: String,

View File

@ -1,4 +1,4 @@
use crate::layer::Layer;
use crate::layer::StyleLayer;
use crate::source::Source;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
@ -9,7 +9,7 @@ pub struct Style {
pub name: String,
pub metadata: HashMap<String, String>,
pub sources: HashMap<String, Source>,
pub layers: Vec<Layer>,
pub layers: Vec<StyleLayer>,
}
impl Default for Style {
@ -20,7 +20,7 @@ impl Default for Style {
metadata: Default::default(),
sources: Default::default(),
layers: vec![
Layer {
StyleLayer {
id: "transportation".to_string(),
typ: "line".to_string(),
maxzoom: None,
@ -30,7 +30,7 @@ impl Default for Style {
source: None,
source_layer: Some("transportation".to_string()),
},
Layer {
StyleLayer {
id: "building".to_string(),
typ: "fill".to_string(),
maxzoom: None,
@ -40,7 +40,7 @@ impl Default for Style {
source: None,
source_layer: Some("building".to_string()),
},
Layer {
StyleLayer {
id: "water".to_string(),
typ: "fill".to_string(),
maxzoom: None,
@ -50,7 +50,7 @@ impl Default for Style {
source: None,
source_layer: Some("water".to_string()),
},
Layer {
StyleLayer {
id: "boundary".to_string(),
typ: "line".to_string(),
maxzoom: None,