Skip to content

PolygonMaterial

PolygonMaterial represents a material for polygon geometry rendering.

Type: boolean | undefined

Description: Specifies whether to apply a water normal map.

Default: undefined

Example:

{
polygon: {
applyWaterNormal: false
}
}

Type: boolean | undefined

Description: Specifies whether the polygon casts shadows.

Default: undefined

Example:

{
polygon: {
castShadow: true
}
}

Type: boolean | undefined

Description: Specifies whether to clamp to the ground.

Default: undefined

Example:

{
polygon: {
clampToGround: true
}
}

Type: Color

Description: Specifies the polygon color as a Color instance.

Default: Required

Example:

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

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:

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

Type: Color | undefined

Description: Specifies the emissive color as a Color instance.

Default: undefined

Example:

import { Color } from "@navaramap/three";
{
polygon: {
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:

{
polygon: {
emissiveIntensity: 0.5
}
}

Type: number | undefined

Description: Specifies the extrusion height. This works when clampToGround is false.

Default: undefined

Example:

{
polygon: {
extrudedHeight: 50 // 50 meters extrusion
}
}

Type: number | undefined

Description: Specifies the height. This works when clampToGround is false. The unit is meters.

Default: undefined

Example:

{
polygon: {
height: 10 // 10 meters height
}
}

Type: number | undefined

Description: Specifies the Index of Refraction. Affects the refraction of light passing through the material.

Default: undefined

Example:

{
polygon: {
ior: 1.5 // Index of refraction for glass
}
}

Type: number | undefined

Description: Specifies the opacity of the polygon. Specified in the range of 0.0 (fully transparent) to 1.0 (fully opaque). Requires transparent to be enabled.

Default: undefined

Example:

{
polygon: {
opacity: 0.5
}
}

Type: boolean | undefined

Description: Whether to compute outline geometry. Only effective at initial load time. When not set, inferred from outlineShow.

Default: undefined

Example:

{
polygon: {
outline: true
}
}

Type: Color | undefined

Description: Specifies the outline color as a Color instance. Currently, this property is only supported for GeoJSON.

Default: undefined

Example:

import { Color } from "@navaramap/three";
{
polygon: {
outlineColor: new Color().setHex(0xff00ff)
}
}

Type: boolean | undefined

Description: Specifies whether to show the outline. Currently, this property is only supported for GeoJSON.

Default: undefined

Example:

{
polygon: {
outlineShow: false
}
}

Type: number | undefined

Description: Specifies the outline width. Currently, this property is only supported for GeoJSON. The unit is pixels.

Default: undefined

Example:

{
polygon: {
outlineWidth: 2
}
}

Type: boolean | undefined

Description: Specifies whether to obtain height from the data. When false, the height is a constant value.

Default: undefined

Example:

{
polygon: {
perPositionHeight: true
}
}

Type: boolean | undefined

Description: Specifies whether the polygon receives shadows.

Default: undefined

Example:

{
polygon: {
receiveShadow: true
}
}

Type: number | undefined

Description: Specifies the reflectivity for post-processing or environment maps.

Default: undefined

Example:

{
polygon: {
reflectivity: 0.5
}
}

Type: number | undefined

Description: Specifies the roughness for post-processing. Specified in the range of 0.0 to 1.0.

Default: undefined

Example:

{
polygon: {
roughness: 0.2
}
}

Type: number | undefined

Description: Specifies the shininess of the material.

Default: undefined

Example:

{
polygon: {
shininess: 100
}
}

Type: boolean | undefined

Description: Specifies whether to show the polygon.

Default: undefined

Example:

{
polygon: {
show: true
}
}

Type: boolean | undefined

Description: Specifies whether to enable the specular effect. When enabled, the shininess and specularStrength values are used.

Default: undefined

Example:

{
polygon: {
specular: true
}
}

Type: number | undefined

Description: Specifies the intensity of specular highlights.

Default: undefined

Example:

{
polygon: {
specularStrength: 2
}
}

Type: boolean | undefined

Description: Specifies whether to show the polygon surface. Currently, this property is only supported for GeoJSON. This is effective when outlineShow is true.

Default: undefined

Example:

{
polygon: {
surfaceShow: true
}
}

Type: boolean | undefined

Description: Specifies whether to enable transparency. Must be set to true to use opacity. May cause unexpected behavior when using effects.

Default: undefined

Example:

{
polygon: {
transparent: true
}
}

Type: boolean | undefined

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

Default: false

Example:

{
polygon: {
tiled: true
}
}

Type: boolean | undefined

Description: Specifies whether to apply a water surface material to the polygon. May slow down mesh loading.

Default: undefined

Example:

{
polygon: {
water: true
}
}

Type: number | undefined

Description: Specifies the scale of the water surface normals. Smaller values make the water surface rougher.

Default: undefined

Example:

{
polygon: {
waterScaleNormal: 2.0
}
}

Type: number | undefined

Description: Specifies the speed of water waves.

Default: undefined

Example:

{
polygon: {
waterSpeed: 0.003
}
}

Type: boolean | undefined

Description: Specifies whether to display as wireframe.

Default: undefined

Example:

{
polygon: {
wireframe: false
}
}