pub struct ExprEvalContext<'a> {
pub zoom: f32,
pub pitch: f32,
pub properties: Option<&'a FeatureProperties>,
pub feature_state: Option<&'a FeatureState>,
}Expand description
Full evaluation context for expressions.
Carries zoom level, optional feature properties (for data-driven styling), and optional feature state (for interactive hover/selection styling).
Fields§
§zoom: f32Current map zoom level (0–22+).
pitch: f32Current camera pitch in degrees.
properties: Option<&'a FeatureProperties>Per-feature properties (from GeoJSON / MVT).
None when evaluating at the layer level (no specific feature).
feature_state: Option<&'a FeatureState>Per-feature mutable state (hover, selected, etc.).
None when feature state is not available.
Implementations§
Source§impl<'a> ExprEvalContext<'a>
impl<'a> ExprEvalContext<'a>
Sourcepub fn with_feature(zoom: f32, properties: &'a FeatureProperties) -> Self
pub fn with_feature(zoom: f32, properties: &'a FeatureProperties) -> Self
Create a context with feature properties for data-driven styling.
Sourcepub fn and_state(self, state: &'a FeatureState) -> Self
pub fn and_state(self, state: &'a FeatureState) -> Self
Add feature state to this context.
Sourcepub fn get_property(&self, key: &str) -> Option<&PropertyValue>
pub fn get_property(&self, key: &str) -> Option<&PropertyValue>
Look up a feature property by key.
Sourcepub fn get_state(&self, key: &str) -> Option<&PropertyValue>
pub fn get_state(&self, key: &str) -> Option<&PropertyValue>
Look up a feature-state value by key.
Trait Implementations§
Source§impl<'a> Clone for ExprEvalContext<'a>
impl<'a> Clone for ExprEvalContext<'a>
Source§fn clone(&self) -> ExprEvalContext<'a>
fn clone(&self) -> ExprEvalContext<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ExprEvalContext<'a>
impl<'a> Debug for ExprEvalContext<'a>
impl<'a> Copy for ExprEvalContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for ExprEvalContext<'a>
impl<'a> RefUnwindSafe for ExprEvalContext<'a>
impl<'a> Send for ExprEvalContext<'a>
impl<'a> Sync for ExprEvalContext<'a>
impl<'a> Unpin for ExprEvalContext<'a>
impl<'a> UnsafeUnpin for ExprEvalContext<'a>
impl<'a> UnwindSafe for ExprEvalContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more