Skip to main content

PlacedSymbol

Struct PlacedSymbol 

Source
pub struct PlacedSymbol {
Show 31 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: SymbolPlacement, pub anchor: GeoCoord, pub world_anchor: [f64; 3], pub text: Option<String>, pub icon_image: Option<String>, pub font_stack: String, pub cross_tile_id: String, pub rotation_rad: f32, pub collision_box: SymbolCollisionBox, pub anchor_mode: SymbolAnchor, pub writing_mode: SymbolWritingMode, pub offset_px: [f32; 2], pub radial_offset: Option<f32>, 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 size_px: f32, pub fill_color: [f32; 4], pub halo_color: [f32; 4], pub opacity: f32, pub visible: bool, pub glyph_quads: Vec<GlyphQuad>,
}
Expand description

A placed symbol after collision resolution.

Fields§

§id: String

Stable symbol id.

§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: SymbolPlacement

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

§anchor: GeoCoord

Geographic anchor point.

§world_anchor: [f64; 3]

World-space anchor point.

§text: Option<String>

Optional text content.

§icon_image: Option<String>

Optional icon image id.

§font_stack: String

Font stack for text rendering.

§cross_tile_id: String

Stable cross-tile identity.

§rotation_rad: f32

Clockwise screen-space rotation in radians for rendering.

§collision_box: SymbolCollisionBox

Collision box used during placement.

§anchor_mode: SymbolAnchor

Selected anchor used for this placement.

§writing_mode: SymbolWritingMode

Writing mode used for this placement.

§offset_px: [f32; 2]

Pixel-space offset applied during placement.

§radial_offset: Option<f32>

Optional radial offset measured in symbol-size units.

§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.

§size_px: f32

Nominal symbol size in pixels.

§fill_color: [f32; 4]

Placeholder fill colour used by current renderers.

§halo_color: [f32; 4]

Placeholder halo colour used by current renderers.

§opacity: f32

Fade opacity in [0, 1].

§visible: bool

Whether the symbol survived collision placement this frame.

§glyph_quads: Vec<GlyphQuad>

Pre-computed glyph positions relative to the symbol anchor (pixels).

Populated by layout_symbol_glyphs. When non-empty the renderer uses these quads directly; when empty it falls back to naive character-by-character layout.

Implementations§

Source§

impl PlacedSymbol

Source

pub fn dependencies(&self) -> SymbolAssetDependencies

Asset dependencies required by this placed symbol.

Trait Implementations§

Source§

impl Clone for PlacedSymbol

Source§

fn clone(&self) -> PlacedSymbol

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 PlacedSymbol

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.