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: StringStable 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: StringStable feature id for feature-state and queries.
feature_index: usizeSource-local feature index.
placement_group_id: StringStable 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: SymbolPlacementWhether this symbol is point-placed or line-placed.
anchor: GeoCoordGeographic anchor point for the symbol.
text: Option<String>Optional label text.
icon_image: Option<String>Optional icon image id.
font_stack: StringFont stack to use for text glyph requests.
cross_tile_id: StringStable cross-tile / cross-frame placement identity.
rotation_rad: f32Clockwise 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: f32Nominal symbol size in pixels.
padding_px: f32Additional collision padding in pixels.
allow_overlap: boolWhether overlap should be allowed.
ignore_placement: boolWhether 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: SymbolIconTextFitIcon 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: SymbolWritingModeWriting 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
impl SymbolCandidate
Sourcepub fn dependencies(&self) -> SymbolAssetDependencies
pub fn dependencies(&self) -> SymbolAssetDependencies
Build asset dependencies for this candidate.
Trait Implementations§
Source§impl Clone for SymbolCandidate
impl Clone for SymbolCandidate
Source§fn clone(&self) -> SymbolCandidate
fn clone(&self) -> SymbolCandidate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more