Lights
#Lights Light sources in 3D scenes.
AmbientLight
Parameters
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| option | Object | optionalparameter
|
Case
//Add ambient light source
let ambientLight = new mapmost.AmbientLight({
color: '#ffffff',
intensity: 1
})
map.addLight(ambientLight)
//Remove ambient light source
map.removeLight(ambientLight)
DirectionalLight
Parameters
| Name | Type | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| option | Object | optionalparameter
|
Case
//Add directional light source
let directionalLight = new mapmost.DirectionalLight({
color: '#ffffff',
intensity: 1,
position: [0, 0, 1]
})
map.addLight(directionalLight)
//Delete directional light source
map.removeLight(directionalLight)
HemisphereLight
Hemispheric light source is a light source located directly above the scene. The light color gradually changes from the sky color to the ground color.
Parameters
| name | type | default value | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| option | Object | optionalparameter
|
Case
//Add hemispheric light source
let hemisphereLight = new mapmost.HemisphereLight({
skyColor: '#ffffff',
groundColor: '#ffffff',
intensity: 1,
position: [0, 0, 1]
})
map.addLight(hemisphereLight)