SymbolLayerStyleProps
Properties
symbolPlacement?
optionalsymbolPlacement:Value<Enum<SymbolPlacementEnum,SymbolPlacementEnumValues>, ["zoom"]>
Label placement relative to its geometry.
symbolSpacing?
optionalsymbolSpacing:Value<number, ["zoom"]>
Distance between two symbol anchors.
symbolAvoidEdges?
optionalsymbolAvoidEdges:Value<boolean, ["zoom"]>
If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.
symbolSortKey?
optionalsymbolSortKey:Value<number, ["zoom","feature"]>
Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When iconAllowOverlap or textAllowOverlap is false, features with a lower sort key will have priority during placement. When iconAllowOverlap or textAllowOverlap is set to true, features with a higher sort key will overlap over features with a lower sort key.
symbolZOrder?
optionalsymbolZOrder:Value<Enum<SymbolZOrderEnum,SymbolZOrderEnumValues>, ["zoom"]>
Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their yPosition relative to the viewport. To control the order and prioritization of symbols otherwise, use symbolSortKey.
iconAllowOverlap?
optionaliconAllowOverlap:Value<boolean, ["zoom"]>
If true, the icon will be visible even if it collides with other previously drawn symbols.
Requires
iconImage
iconIgnorePlacement?
optionaliconIgnorePlacement:Value<boolean, ["zoom"]>
If true, other symbols can be visible even if they collide with the icon.
Requires
iconImage
iconOptional?
optionaliconOptional:Value<boolean, ["zoom"]>
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
Requires
iconImage, textField
iconRotationAlignment?
optionaliconRotationAlignment:Value<Enum<IconRotationAlignmentEnum,IconRotationAlignmentEnumValues>, ["zoom"]>
In combination with symbolPlacement, determines the rotation behavior of icons.
Requires
iconImage
iconSize?
optionaliconSize:Value<number, ["zoom","feature"]>
Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by iconSize. 1 is the original size; 3 triples the size of the image.
Requires
iconImage
iconTextFit?
optionaliconTextFit:Value<Enum<IconTextFitEnum,IconTextFitEnumValues>, ["zoom","feature"]>
Scales the icon to fit around the associated text.
Requires
iconImage, textField
iconTextFitPadding?
optionaliconTextFitPadding:Value<number[], ["zoom","feature"]>
Size of the additional area added to dimensions determined by iconTextFit, in clockwise order: top, right, bottom, left.
Requires
iconImage, textField
iconImage?
optionaliconImage:Value<ResolvedImageType, ["zoom","feature"]>
Name of image in sprite to use for drawing an image background.
iconRotate?
optionaliconRotate:Value<number, ["zoom","feature"]>
Rotates the icon clockwise.
Requires
iconImage
iconPadding?
optionaliconPadding:Value<number, ["zoom"]>
Size of the additional area around the icon bounding box used for detecting symbol collisions.
Requires
iconImage
iconKeepUpright?
optionaliconKeepUpright:Value<boolean, ["zoom"]>
If true, the icon may be flipped to prevent it from being rendered upsideDown.
Requires
iconImage
iconOffset?
optionaliconOffset:Value<number[], ["zoom","feature"]>
Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of iconSize to obtain the final offset in pixels. When combined with iconRotate the offset will be as if the rotated direction was up.
Requires
iconImage
iconAnchor?
optionaliconAnchor:Value<Enum<IconAnchorEnum,IconAnchorEnumValues>, ["zoom","feature"]>
Part of the icon placed closest to the anchor.
Requires
iconImage
iconPitchAlignment?
optionaliconPitchAlignment:Value<Enum<IconPitchAlignmentEnum,IconPitchAlignmentEnumValues>, ["zoom"]>
Orientation of icon when map is pitched.
Requires
iconImage
textPitchAlignment?
optionaltextPitchAlignment:Value<Enum<TextPitchAlignmentEnum,TextPitchAlignmentEnumValues>, ["zoom"]>
Orientation of text when map is pitched.
Requires
textField
textRotationAlignment?
optionaltextRotationAlignment:Value<Enum<TextRotationAlignmentEnum,TextRotationAlignmentEnumValues>, ["zoom"]>
In combination with symbolPlacement, determines the rotation behavior of the individual glyphs forming the text.
Requires
textField
textField?
optionaltextField:Value<string, ["zoom","feature"]>
Value to use for a text label. If a plain string is provided, it will be treated as a formatted with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.
textFont?
optionaltextFont:Value<string[], ["zoom","feature"]>
Font stack to use for displaying text.
Requires
textField
textSize?
optionaltextSize:Value<number, ["zoom","feature"]>
Font size.
Requires
textField
textMaxWidth?
optionaltextMaxWidth:Value<number, ["zoom","feature"]>
The maximum line width for text wrapping.
Requires
textField
textLineHeight?
optionaltextLineHeight:Value<number, ["zoom","feature"]>
Text leading value for multiLine text.
Requires
textField
textLetterSpacing?
optionaltextLetterSpacing:Value<number, ["zoom","feature"]>
Text tracking amount.
Requires
textField
textJustify?
optionaltextJustify:Value<Enum<TextJustifyEnum,TextJustifyEnumValues>, ["zoom","feature"]>
Text justification options.
Requires
textField
textRadialOffset?
optionaltextRadialOffset:Value<number, ["zoom","feature"]>
Radial offset of text, in the direction of the symbol's anchor. Useful in combination with textVariableAnchor, which defaults to using the twoDimensional textOffset if present.
Requires
textField
textVariableAnchor?
optionaltextVariableAnchor:Value<Enum<TextVariableAnchorEnum,TextVariableAnchorEnumValues>[], ["zoom"]>
To increase the chance of placing highPriority labels on the map, you can provide an array of textAnchor locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use textJustify: auto to choose justification based on anchor position. To apply an offset, use the textRadialOffset or the twoDimensional textOffset.
Requires
textField
textAnchor?
optionaltextAnchor:Value<Enum<TextAnchorEnum,TextAnchorEnumValues>, ["zoom","feature"]>
Part of the text placed closest to the anchor.
Requires
textField
Disabled By
textVariableAnchor
textMaxAngle?
optionaltextMaxAngle:Value<number, ["zoom"]>
Maximum angle change between adjacent characters.
Requires
textField
textWritingMode?
optionaltextWritingMode:Value<Enum<TextWritingModeEnum,TextWritingModeEnumValues>[], ["zoom"]>
The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.
Requires
textField
textRotate?
optionaltextRotate:Value<number, ["zoom","feature"]>
Rotates the text clockwise.
Requires
textField
textPadding?
optionaltextPadding:Value<number, ["zoom"]>
Size of the additional area around the text bounding box used for detecting symbol collisions.
Requires
textField
textKeepUpright?
optionaltextKeepUpright:Value<boolean, ["zoom"]>
If true, the text may be flipped vertically to prevent it from being rendered upsideDown.
Requires
textField
textTransform?
optionaltextTransform:Value<Enum<TextTransformEnum,TextTransformEnumValues>, ["zoom","feature"]>
Specifies how to capitalize text, similar to the CSS textTransform property.
Requires
textField
textOffset?
optionaltextOffset:Value<number[], ["zoom","feature"]>
Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with textVariableAnchor, input values will be taken as absolute values. Offsets along the x and yAxis will be applied automatically based on the anchor position.
Requires
textField
Disabled By
textRadialOffset
textAllowOverlap?
optionaltextAllowOverlap:Value<boolean, ["zoom"]>
If true, the text will be visible even if it collides with other previously drawn symbols.
Requires
textField
textIgnorePlacement?
optionaltextIgnorePlacement:Value<boolean, ["zoom"]>
If true, other symbols can be visible even if they collide with the text.
Requires
textField
textOptional?
optionaltextOptional:Value<boolean, ["zoom"]>
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
Requires
textField, iconImage
visibility?
optionalvisibility:Value<Enum<VisibilityEnum,VisibilityEnumValues>, []>
Whether this layer is displayed.
iconOpacity?
optionaliconOpacity:Value<number, ["zoom","feature","feature-state","measure-light"]>
The opacity at which the icon will be drawn.
Requires
iconImage
iconOpacityTransition?
optionaliconOpacityTransition:Transition
The transition affecting any changes to this layer’s iconOpacity property.
iconColor?
optionaliconColor:Value<string, ["zoom","feature","feature-state","measure-light"]>
The color of the icon. This can only be used with SDF icons.
Requires
iconImage
iconColorTransition?
optionaliconColorTransition:Transition
The transition affecting any changes to this layer’s iconColor property.
iconHaloColor?
optionaliconHaloColor:Value<string, ["zoom","feature","feature-state","measure-light"]>
The color of the icon's halo. Icon halos can only be used with SDF icons.
Requires
iconImage
iconHaloColorTransition?
optionaliconHaloColorTransition:Transition
The transition affecting any changes to this layer’s iconHaloColor property.
iconHaloWidth?
optionaliconHaloWidth:Value<number, ["zoom","feature","feature-state","measure-light"]>
Distance of halo to the icon outline.
Requires
iconImage
iconHaloWidthTransition?
optionaliconHaloWidthTransition:Transition
The transition affecting any changes to this layer’s iconHaloWidth property.
iconHaloBlur?
optionaliconHaloBlur:Value<number, ["zoom","feature","feature-state","measure-light"]>
Fade out the halo towards the outside.
Requires
iconImage
iconHaloBlurTransition?
optionaliconHaloBlurTransition:Transition
The transition affecting any changes to this layer’s iconHaloBlur property.
iconTranslate?
optionaliconTranslate:Value<Translation, ["zoom"]>
Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
Requires
iconImage
iconTranslateTransition?
optionaliconTranslateTransition:Transition
The transition affecting any changes to this layer’s iconTranslate property.
iconTranslateAnchor?
optionaliconTranslateAnchor:Value<Enum<IconTranslateAnchorEnum,IconTranslateAnchorEnumValues>, ["zoom"]>
Controls the frame of reference for iconTranslate.
Requires
iconImage, iconTranslate
textOpacity?
optionaltextOpacity:Value<number, ["zoom","feature","feature-state","measure-light"]>
The opacity at which the text will be drawn.
Requires
textField
textOpacityTransition?
optionaltextOpacityTransition:Transition
The transition affecting any changes to this layer’s textOpacity property.
textColor?
optionaltextColor:Value<string, ["zoom","feature","feature-state","measure-light"]>
The color with which the text will be drawn.
Requires
textField
textColorTransition?
optionaltextColorTransition:Transition
The transition affecting any changes to this layer’s textColor property.
textHaloColor?
optionaltextHaloColor:Value<string, ["zoom","feature","feature-state","measure-light"]>
The color of the text's halo, which helps it stand out from backgrounds.
Requires
textField
textHaloColorTransition?
optionaltextHaloColorTransition:Transition
The transition affecting any changes to this layer’s textHaloColor property.
textHaloWidth?
optionaltextHaloWidth:Value<number, ["zoom","feature","feature-state","measure-light"]>
Distance of halo to the font outline. Max text halo width is 1/4 of the fontSize.
Requires
textField
textHaloWidthTransition?
optionaltextHaloWidthTransition:Transition
The transition affecting any changes to this layer’s textHaloWidth property.
textHaloBlur?
optionaltextHaloBlur:Value<number, ["zoom","feature","feature-state","measure-light"]>
The halo's fadeout distance towards the outside.
Requires
textField
textHaloBlurTransition?
optionaltextHaloBlurTransition:Transition
The transition affecting any changes to this layer’s textHaloBlur property.
textTranslate?
optionaltextTranslate:Value<Translation, ["zoom"]>
Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
Requires
textField
textTranslateTransition?
optionaltextTranslateTransition:Transition
The transition affecting any changes to this layer’s textTranslate property.
textTranslateAnchor?
optionaltextTranslateAnchor:Value<Enum<TextTranslateAnchorEnum,TextTranslateAnchorEnumValues>, ["zoom"]>
Controls the frame of reference for textTranslate.
Requires
textField, textTranslate
symbolZElevate?
optionalsymbolZElevate:Value<boolean, ["zoom"]>
Position symbol on buildings (both fill extrusions and models) roof tops. In order to have minimal impact on performance, this is supported only when fillExtrusionHeight is not zoomDependent and not edited after initial bucket creation. For fading in buildings when zooming in, fillExtrusionVerticalScale should be used and symbols would raise with building roofs. Symbols are sorted by elevation, except in case when viewportY sorting or symbolSortKey are applied.
iconEmissiveStrength?
optionaliconEmissiveStrength:Value<number, ["zoom","measure-light"]>
Controls the intensity of light emitted on the source features.
Requires
lights
iconEmissiveStrengthTransition?
optionaliconEmissiveStrengthTransition:Transition
The transition affecting any changes to this layer’s iconEmissiveStrength property.
textEmissiveStrength?
optionaltextEmissiveStrength:Value<number, ["zoom","measure-light"]>
Controls the intensity of light emitted on the source features.
Requires
lights
textEmissiveStrengthTransition?
optionaltextEmissiveStrengthTransition:Transition
The transition affecting any changes to this layer’s textEmissiveStrength property.
iconImageCrossFade?
optionaliconImageCrossFade:Value<number, ["zoom","feature","feature-state","measure-light"]>
Controls the transition progress between the image variants of iconImage. Zero means the first variant is used, one is the second, and in between they are blended together.
iconImageCrossFadeTransition?
optionaliconImageCrossFadeTransition:Transition
The transition affecting any changes to this layer’s iconImageCrossFade property.