remove nature

This commit is contained in:
Artemy 2024-05-30 12:22:27 +03:00
parent d028617736
commit 93788e7065
3 changed files with 8 additions and 20 deletions

View file

@ -3,7 +3,7 @@ use std::{fs, path::Path, time};
use serde_json::json;
use crate::{
types::{CountryData, ToCollection},
types::{CountryData, ToCollection, ToFeatures},
utils::{
diff_countries, get_country, is_match, read_config, rewrite_if_some, rewrite_if_some_option,
},
@ -82,8 +82,6 @@ pub fn build() {
countries
};
// TODO: Add nature support
{
let generated_time = time::Instant::now();
let countries_json = serde_json::to_string_pretty(&serde_json::Map::from_iter(

View file

@ -30,16 +30,3 @@ output_folder = "./out/map"
# foundation_date = "2024-01-01"
# flag = "https://example.com/flag.png"
# about = "https://example.com/about.html"
# Additional nature layers
[[nature]]
id = "water"
color = "#75cff0"
[[nature]]
id = "sand"
color = "#efe9e1"
[[nature]]
id = "grass"
color = "#d1e6be"

View file

@ -242,16 +242,19 @@ impl ToFeatures for CountryData {
impl ToCollection for Vec<CountryData> {
fn to_collection(self) -> geojson::FeatureCollection {
geojson::FeatureCollection {
features: self
.iter()
.flat_map(|c| c.to_features())
.collect::<Vec<geojson::Feature>>(),
features: self.to_features(),
bbox: None,
foreign_members: None,
}
}
}
impl ToFeatures for Vec<CountryData> {
fn to_features(&self) -> Vec<geojson::Feature> {
self.iter().flat_map(|c| c.to_features()).collect()
}
}
impl ToCollection for Vec<geojson::Feature> {
fn to_collection(self) -> geojson::FeatureCollection {
geojson::FeatureCollection {