MapboxGL.Light

Light represents the light source for extruded geometries

灯光表示拉伸几何图形的光源

props

Prop Type Default Required Description
style custom none false Customizable style attributes

可自定义的样式属性

styles


Name

anchor

Description

Whether extruded geometries are lit relative to the map or viewport.

Type

enum

Default Value

viewport

Supported Values

map - The position of the light source is aligned to the rotation of the map.

光源的位置与地图的旋转对齐
viewport - The position of the light source is aligned to the rotation of the viewport.

光源的位置与视口的旋转对齐

Expression

Parameters: zoom


Name

position

Description

Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when light.anchor is set to viewport corresponds to the top of the viewport, or 0° when light.anchor is set to map corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).
光源相对于照明(拉伸)几何图形的位置,在[r径向坐标,方位角,p极角]中,其中r表示从对象的底部的中心到其光的距离,a表示光相对于0°的位置(当light.anchor设置为‘viewport时为0°时,对应于视口的顶部,或者当light.anchor设置为map`时为0°,对应于正北,度顺时针进行),p表示光的高度(从0°,正上方,到180°,正下方)。

Type

array

Default Value

[1.15,210,30]

Expression

Parameters: zoom


Name

color

Description

Color tint for lighting extruded geometries.
照明拉伸几何图形的颜色色调。

Type

color

Default Value

#ffffff

Expression

Parameters: zoom


Name

intensity

Description

Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.
照明强度(从0到1的刻度)。更高的数字将表现为更极端的对比。

Type

number

Default Value

0.5

Minimum

0

Maximum

1

Expression

Parameters: zoom

你可能感兴趣的:(MapboxGL.Light)