C

WebGLIconLabelStyle

An icon label style for use in WebGL2 rendering.
ImplementsInheritance Hierarchy

Remarks

Note that unlike other ILabelStyle implementations, this class is immutable. All properties are read-only and immutable, and the class cannot be subclassed, either.

See Also

Developer's Guide

API

WebGLLabelStyle

Members

No filters for this type

Constructors

Creates a new icon label style that is rendered with WebGL2.

This style can be applied to labels that are rendered by the WebGLGraphModelManager.

The preferred way of calling the constructor is using option arguments, as there are many defaults and optional arguments. To use the default value for a color option, set it to null.

Parameters

icon: ImageData
The mandatory image data for the icon to be used for the label.
iconColor?: Color
The fill color of the icon, or null. If this parameter is null, the original color of the icon is used. Otherwise the alpha values of the icon will be combined with the color values from this value. Defaults to null.
backgroundColor?: Color
The color of the label's background. Defaults to TRANSPARENT, which does not render a background.
backgroundStroke?: WebGLStroke
The color of the label's background border. Defaults to NONE, which does not render a stroke.
padding?: Insets
The padding of the text within the label's bounds. Defaults to empty insets.
backgroundShape?: WebGLLabelShape
The shape of the label's background. Defaults to RECTANGLE.
effect?: WebGLEffect
The effect around the label. Defaults to NONE.
textureRendering?: WebGLTextureRendering
Rendering hint on how to resolve blurriness of icon images at large zoom levels. Defaults to INTERPOLATED. We recommend not using SDF for images that contain gradients.

Properties

Gets the fill color for the background of the shape.
readonlyfinal
Gets the shape of the label's background.
Adjust the padding to ensure that rounded shapes still contain the complete text.
readonlyfinal
Gets the color of the stroke around the shape.
readonlyfinal
Gets the set of applied effects on this style.
readonlyfinal
Gets the ImageData of the icon to render.
readonlyfinal
Gets the fill color for the icon, or null.
If null is specified, the original color of the icon is used. Setting this to a non-null value will use the alpha values from the image and combine them with the RGB color specified here.
readonlyfinal
Gets the padding of the text within the label's bounds.
readonlyfinal
Gets the renderer implementation that can be queried for implementations that provide details about the visual appearance and visual behavior for a given label and this style instance.
The idiom for retrieving, e.g. an IVisualCreator implementation for a given style is:
const creator = style.renderer.getVisualCreator(label, style)
const visual = creator.createVisual(context)
readonlyfinal
Gets the rendering hint on how to resolve blurriness of icon images on large zoom values.
Default value is INTERPOLATED. We recommend not using SDF for images that contain gradients.
readonlyfinal

Methods

Create a clone of this object.
final

Return Value

Object
A clone of this object.