light(light)
lightProperty provides global lighting for the map. lightAttribute impactfill-extrusionLayers, the specific usage methods are as follows:
"light": {
"anchor": `"viewport"`,
"color": "white",
"intensity": 0.4
}
View lighting method (Anchor)
Optional attribute.enum。 Optional"map"、"viewport"One of the, the default is"viewport"。
fill-extrusionWhether the layer’s geometry is lit relative to the map or view.
"map": The light source’s position is aligned with the map’s rotation.
"viewport": The position of the light source is aligned with the rotation of the view.
"anchor": `"map"`
color(Color)
Optional attribute.color。default"#ffffff"。supportinterpolateexpression.Transitionable.
for lightingfill-extrusionThe color tint of the layer geometry.
Light intensity (Intensity)
Optional attribute. between0~1ofnumber,default value0.5。supportinterpolateexpression.Transitionable.
light intensity(from0arrive1)。The larger the value, the stronger the light.
Location(Position)
Optional attribute.array。default value[1.15,210,30]。supportinterpolateexpression.Transitionable.
The position of the light source relative to the geometry being lit (extruded), in[rpolar coordinates,aazimuth angle,ppolar angle]middle,rRepresents the distance from the bottom center of the object to the light source,aIndicates that the light source is relative to0°position (when the light source is0°hour. The anchor point is set to correspond to the top of the view, or when the light source is0°。 The anchor point is set to the north direction of the map and rotates clockwise),pRepresents the height of the light source (from0°arrive180°)。
"position": [
1.5,
90,
80
]