光照
全局光源;
light: {"anchor": "viewport", "color": "white", "intensity": 0.4}
anchor
可选枚举值。可能的值:map、viewport。默认为"viewport"。
确定挤出几何体是相对于地图还是视口进行照明;
map:光源的位置与地图的旋转对齐;viewport:光源的位置与视口的旋转对齐;anchor: "map"
| SDK支持 | MapLibre GL JS | MapLibre Native Android | MapLibre Native iOS |
|---|---|---|---|
| 基本功能 | 0.27.0 | 5.1.0 | 3.6.0 |
position
可选数组。默认为[1.15,210,30]。支持插值表达式。可过渡。
光源相对于被照明(挤出)几何体的位置,以 [r 径向坐标, a 方位角, p 极角] 表示,其中 r 表示从物体基座中心到其光源的距离,a 表示光源相对于0°的位置(当light.anchor设置为viewport时,0°对应于视口顶部,或当light.anchor设置为map时,0°对应于正北方向,角度沿顺时针方向增加),p 表示光源的高度(从0°,正上方,到180°,正下方);
position: [1.5, 90, 80]
| SDK支持 | MapLibre GL JS | MapLibre Native Android | MapLibre Native iOS |
|---|---|---|---|
| 基本功能 | 0.27.0 | 5.1.0 | 3.6.0 |
color
可选颜色。默认为"#ffffff"。支持插值表达式。可过渡。
照明挤出几何体的颜色色调;
| SDK支持 | MapLibre GL JS | MapLibre Native Android | MapLibre Native iOS |
|---|---|---|---|
| 基本功能 | 0.27.0 | 5.1.0 | 3.6.0 |
intensity
可选范围为[0, 1]的数值。默认为0.5。支持插值表达式。可过渡。
照明的强度(范围从0到1)。较高的数值将呈现为更极端的对比度;
| SDK支持 | MapLibre GL JS | MapLibre Native Android | MapLibre Native iOS |
|---|---|---|---|
| 基本功能 | 0.27.0 | 5.1.0 | 3.6.0 |