Skip to main content

SymbolStyleLayer

Struct SymbolStyleLayer 

Source
pub struct SymbolStyleLayer {
Show 35 fields pub meta: StyleLayerMeta, pub source: StyleSourceId, pub source_layer: Option<String>, pub color: StyleValue<[f32; 4]>, pub halo_color: StyleValue<[f32; 4]>, pub size: StyleValue<f32>, pub text_field: Option<StyleValue<String>>, pub icon_image: Option<StyleValue<String>>, pub font_stack: StyleValue<String>, pub padding: StyleValue<f32>, pub allow_overlap: StyleValue<bool>, pub text_allow_overlap: Option<StyleValue<bool>>, pub icon_allow_overlap: Option<StyleValue<bool>>, pub text_optional: Option<StyleValue<bool>>, pub icon_optional: Option<StyleValue<bool>>, pub text_ignore_placement: Option<StyleValue<bool>>, pub icon_ignore_placement: Option<StyleValue<bool>>, pub radial_offset: Option<StyleValue<f32>>, pub variable_anchor_offsets: Option<Vec<(SymbolAnchor, [f32; 2])>>, pub anchor: SymbolAnchor, pub justify: StyleValue<SymbolTextJustify>, pub transform: StyleValue<SymbolTextTransform>, pub max_width: Option<StyleValue<f32>>, pub line_height: Option<StyleValue<f32>>, pub letter_spacing: Option<StyleValue<f32>>, pub icon_text_fit: StyleValue<SymbolIconTextFit>, pub icon_text_fit_padding: [f32; 4], pub sort_key: Option<StyleValue<f32>>, pub placement: SymbolPlacement, pub spacing: StyleValue<f32>, pub max_angle: StyleValue<f32>, pub keep_upright: StyleValue<bool>, pub variable_anchors: Vec<SymbolAnchor>, pub writing_mode: SymbolWritingMode, pub offset: [f32; 2],
}
Expand description

Symbol layer style spec.

Fields§

§meta: StyleLayerMeta§source: StyleSourceId§source_layer: Option<String>

Optional source-layer name for vector-tile-like sources.

§color: StyleValue<[f32; 4]>§halo_color: StyleValue<[f32; 4]>§size: StyleValue<f32>§text_field: Option<StyleValue<String>>§icon_image: Option<StyleValue<String>>§font_stack: StyleValue<String>§padding: StyleValue<f32>§allow_overlap: StyleValue<bool>

Shared overlap fallback for simplified callers.

§text_allow_overlap: Option<StyleValue<bool>>

Explicit text overlap control from the style specification.

§icon_allow_overlap: Option<StyleValue<bool>>

Explicit icon overlap control from the style specification.

§text_optional: Option<StyleValue<bool>>

Whether text may be dropped while keeping the icon.

§icon_optional: Option<StyleValue<bool>>

Whether the icon may be dropped while keeping the text.

§text_ignore_placement: Option<StyleValue<bool>>

Whether text may be placed without blocking later symbols.

§icon_ignore_placement: Option<StyleValue<bool>>

Whether the icon may be placed without blocking later symbols.

§radial_offset: Option<StyleValue<f32>>

Radial text offset measured in text-size units.

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

Explicit per-anchor offsets for variable anchor placement.

§anchor: SymbolAnchor

Default anchor when variable anchors are not in use.

§justify: StyleValue<SymbolTextJustify>

Requested text justification.

§transform: StyleValue<SymbolTextTransform>

Text transformation applied before shaping and measurement.

§max_width: Option<StyleValue<f32>>

Maximum point-label width before wrapping.

§line_height: Option<StyleValue<f32>>

Preferred wrapped text line height.

§letter_spacing: Option<StyleValue<f32>>

Extra spacing between adjacent glyphs.

§icon_text_fit: StyleValue<SymbolIconTextFit>

Icon sizing mode relative to text.

§icon_text_fit_padding: [f32; 4]

Padding applied when fitting an icon around text.

§sort_key: Option<StyleValue<f32>>

Placement priority for symbol ordering.

§placement: SymbolPlacement

Whether symbols are placed at points or anchored along lines.

§spacing: StyleValue<f32>

Preferred spacing for repeated line-placed symbols.

§max_angle: StyleValue<f32>

Maximum cumulative turn angle tolerated for a line-placed label.

§keep_upright: StyleValue<bool>

Whether line-placed text should be flipped to remain upright.

§variable_anchors: Vec<SymbolAnchor>§writing_mode: SymbolWritingMode§offset: [f32; 2]

Implementations§

Source§

impl SymbolStyleLayer

Source

pub fn new(id: impl Into<String>, source: impl Into<String>) -> Self

Create a symbol style layer bound to the given style source id.

Trait Implementations§

Source§

impl Clone for SymbolStyleLayer

Source§

fn clone(&self) -> SymbolStyleLayer

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 SymbolStyleLayer

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.