Skip to main content

SymbolCandidate

Struct SymbolCandidate 

Source
pub struct SymbolCandidate {
Show 32 fields pub id: String, pub layer_id: Option<String>, pub source_id: Option<String>, pub source_layer: Option<String>, pub source_tile: Option<TileId>, pub feature_id: String, pub feature_index: usize, pub placement_group_id: String, pub placement: SymbolPlacement, pub anchor: GeoCoord, pub text: Option<String>, pub icon_image: Option<String>, pub font_stack: String, pub cross_tile_id: String, pub rotation_rad: f32, pub size_px: f32, pub padding_px: f32, pub allow_overlap: bool, pub ignore_placement: bool, pub sort_key: Option<f32>, pub radial_offset: Option<f32>, pub variable_anchor_offsets: Option<Vec<(SymbolAnchor, [f32; 2])>>, pub text_max_width: Option<f32>, pub text_line_height: Option<f32>, pub text_letter_spacing: Option<f32>, pub icon_text_fit: SymbolIconTextFit, pub icon_text_fit_padding: [f32; 4], pub anchors: Vec<SymbolAnchor>, pub writing_mode: SymbolWritingMode, pub offset_px: [f32; 2], pub fill_color: [f32; 4], pub halo_color: [f32; 4],
}
Expand description

Candidate symbol generated from a symbol layer before placement.

Fields§

§id: String

Stable per-feature candidate id used for fade persistence.

§layer_id: Option<String>

Originating style/runtime layer id, when known.

§source_id: Option<String>

Originating style source id, when known.

§source_layer: Option<String>

Originating style source-layer id, when known.

§source_tile: Option<TileId>

Tile that supplied the symbol feature, when known.

§feature_id: String

Stable feature id for feature-state and queries.

§feature_index: usize

Source-local feature index.

§placement_group_id: String

Stable group id for candidate variants of the same conceptual symbol.

Most symbols only generate one candidate, so this matches the unique per-feature candidate id. When optional text/icon fallback variants are emitted, they all share this group id so placement can choose the first variant that fits without treating the fallbacks as unrelated symbols.

§placement: SymbolPlacement

Whether this symbol is point-placed or line-placed.

§anchor: GeoCoord

Geographic anchor point for the symbol.

§text: Option<String>

Optional label text.

§icon_image: Option<String>

Optional icon image id.

§font_stack: String

Font stack to use for text glyph requests.

§cross_tile_id: String

Stable cross-tile / cross-frame placement identity.

§rotation_rad: f32

Clockwise screen-space rotation in radians for line-following labels.

Point-placed symbols keep this at 0. Line-placed symbols use the local path direction at the chosen anchor so placeholder rendering can start following the line before full glyph shaping along paths exists.

§size_px: f32

Nominal symbol size in pixels.

§padding_px: f32

Additional collision padding in pixels.

§allow_overlap: bool

Whether overlap should be allowed.

§ignore_placement: bool

Whether this symbol should avoid blocking later symbols.

§sort_key: Option<f32>

Optional placement ordering key.

Lower keys are placed first. None means the candidate keeps source order relative to other unsorted symbols.

§radial_offset: Option<f32>

Optional radial offset measured in symbol-size units.

§variable_anchor_offsets: Option<Vec<(SymbolAnchor, [f32; 2])>>

Explicit per-anchor offsets for variable anchor placement.

§text_max_width: Option<f32>

Maximum point-label width before wrapping.

§text_line_height: Option<f32>

Preferred wrapped text line height.

§text_letter_spacing: Option<f32>

Extra spacing between adjacent glyphs.

§icon_text_fit: SymbolIconTextFit

Icon sizing mode relative to the text box.

§icon_text_fit_padding: [f32; 4]

Padding applied when fitting the icon around text.

§anchors: Vec<SymbolAnchor>

Preferred anchor candidates in priority order.

§writing_mode: SymbolWritingMode

Writing mode used to estimate collision and layout dimensions.

§offset_px: [f32; 2]

Pixel-space text/icon offset.

§fill_color: [f32; 4]

Primary fill colour used for placeholder rendering.

§halo_color: [f32; 4]

Halo colour used for placeholder rendering.

Implementations§

Source§

impl SymbolCandidate

Source

pub fn dependencies(&self) -> SymbolAssetDependencies

Build asset dependencies for this candidate.

Trait Implementations§

Source§

impl Clone for SymbolCandidate

Source§

fn clone(&self) -> SymbolCandidate

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SymbolCandidate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.