use std::collections::BTreeMap;
use crate::value::Value;
#[derive(Debug, Clone, Default)]
pub struct Feature {
pub id: Option<Value>,
pub properties: BTreeMap<String, Value>,
pub geometry_type: Option<String>,
pub state: BTreeMap<String, Value>,
pub geometry: Vec<Vec<(f64, f64)>>,
}
#[derive(Debug, Clone, Default)]
pub struct EvaluationContext {
pub zoom: Option<f64>,
pub feature: Feature,
pub global_state: BTreeMap<String, Value>,
pub available_images: Vec<String>,
pub canonical: Option<(u32, u32, u32)>,
pub heatmap_density: Option<f64>,
pub elevation: Option<f64>,
pub line_progress: Option<f64>,
}
impl EvaluationContext {
pub fn new() -> EvaluationContext {
EvaluationContext::default()
}
pub fn with_zoom(mut self, zoom: f64) -> EvaluationContext {
self.zoom = Some(zoom);
self
}
pub fn with_feature(mut self, feature: Feature) -> EvaluationContext {
self.feature = feature;
self
}
pub fn with_global_state(mut self, state: BTreeMap<String, Value>) -> EvaluationContext {
self.global_state = state;
self
}
}