ProjectedLineRenderable
A polyline drawn with a constant screen-space width.
The line is extruded in the vertex shader so its width stays fixed in pixels at any zoom level. Custom layers can construct it directly for paths and outlines.
Extends RenderableObject and inherits all public properties and methods.
Constructor
Creates a projected line renderable for the given path geometry.
ts
new ProjectedLineRenderable(props): ProjectedLineRenderable;| Parameter | Description |
|---|---|
props: ProjectedLineRenderableProps | Initialization properties. |
Types
ProjectedLineRenderableProps
Initialization properties for constructing a projected line renderable.
| Property | Description |
|---|---|
geometry: ProjectedLineGeometry | The line path geometry to draw. |
color: ColorLike | The line color. |
width: number | Line width in pixels. |
Accessors
type string overrides
Identifies the renderable type as ProjectedLineRenderable.
ts
get type(): string;color Color
The line color. Assignable from any ColorLike value.
ts
get color(): Color;ts
set color(value): void;| Parameter | Description |
|---|---|
value: ColorLike | The new line color. |
width number
The line width in pixels.
ts
get width(): number;ts
set width(value): void;| Parameter | Description |
|---|---|
value: number | The new width in pixels. |
Methods
getUniforms() overrides
Returns the color and width uniforms for the line shader.
ts
getUniforms(): {
u_lineColor: [number, number, number];
u_lineWidth: number;
};