Skip to content

PolylineMaterial

PolylineMaterial represents a material for polyline geometry rendering.

Type: boolean | undefined

Description: Specifies whether the polyline casts shadows.

Default: undefined

Example:

{
polyline: {
castShadow: true
}
}

Type: boolean

Description: Specifies whether to clamp the polyline to the ground.

Default: Required

Example:

{
polyline: {
clampToGround: true
}
}

Type: Color

Description: Specifies the polyline color as a Color instance.

Default: Required

Example:

import { Color } from "@navaramap/three";
{
polyline: {
color: new Color().setHex(0x0066cc)
}
}

Type: boolean | undefined

Description: Enables writing to the depth buffer. Set to false for transparent materials to prevent depth sorting issues.

Default: true

Example:

{
polyline: {
depthWrite: false
}
}

Type: string[] | undefined

Description: Specifies the IDs of selective effects to apply (e.g., “bloom”, “outline”). Used in conjunction with SelectiveBloomEffectDesc or SelectiveOutlineEffectDesc.

Default: undefined

Example:

{
polyline: {
effectIds: ["bloom", "outline"]
}
}

Type: Color | undefined

Description: Specifies the emissive color as a Color instance.

Default: undefined

Example:

import { Color } from "@navaramap/three";
{
polyline: {
emissiveColor: new Color().setHex(0xff0000)
}
}

Type: number | undefined

Description: Specifies the emissive intensity. The default value is 0.3 when the Bloom effect is enabled.

Default: undefined

Example:

{
polyline: {
emissiveIntensity: 0.5
}
}

Type: ("line" | "polygon")[] | undefined

Description: Source geometry categories this material consumes. When set to include "polygon", polygon boundary rings (the outer ring and any holes) render as closed polylines at the ring’s base height. Extruded side edges are not included, so use the polygon material’s outline for extruded polygons. Setting the array replaces the default, so include "line" when line geometry should keep rendering. This option applies when the layer’s geometry is built: set it at layer creation. layer.update() applies a new value only to tiles loaded afterwards, so already-loaded tiles keep their previous geometry until the layer is re-created.

Default: ["line"]

Example:

{
polyline: {
geometryTypes: ["line", "polygon"]
}
}

Type: number | undefined

Description: Specifies the height of the polyline. The unit is meters.

Default: undefined

Example:

{
polyline: {
height: 1
}
}

Type: boolean | undefined

Description: Applies the lighting equation to the color output. When false, the polyline renders as plain albedo. The rest of the lit pipeline still runs, so normals and the shadow G-buffer keep being written. Leaving it unset follows the scene default, view.lit. Setting it explicitly overrides that default in either direction.

Default: undefined (follows view.lit)

Example:

{
polyline: {
lit: false // Plain albedo output, e.g. for a deferred lighting pass
}
}

Type: number | undefined

Description: Maximum line width in pixels, clamping the rendered width regardless of zoom level. Smaller values are cheaper to render as they reduce fragment shader overdraw.

Default: undefined

Example:

{
polyline: {
maxWidth: 10
}
}

Type: boolean | undefined

Description: Specifies whether the polyline receives shadows.

Default: undefined

Example:

{
polyline: {
receiveShadow: true
}
}

Type: boolean | undefined

Description: Specifies whether to show the polyline.

Default: undefined

Example:

{
polyline: {
show: true
}
}

Type: boolean | undefined

Description: Enables transparency and alpha blending. This allows the polyline to be rendered with opacity.

Default: false

Example:

{
polyline: {
transparent: true
}
}

Type: boolean | undefined

Description: Splits the polyline into XYZ vector tiles for rendering, even when the data source is not an MVT layer. This can improve performance for large polylines. Enabling clampToGround implicitly forces tiled to true.

Default: false

Example:

{
polyline: {
tiled: true
}
}

Type: number

Description: Specifies the width of the polyline. The unit is pixels.

Default: Required

Example:

{
polyline: {
width: 3
}
}