import Environment from "@arcgis/core/webscene/Environment.js";const Environment = await $arcgis.import("@arcgis/core/webscene/Environment.js");- Inheritance:
- Environment→
Accessor
- Subclasses:
- Environment
- Since
- ArcGIS Maps SDK for JavaScript 4.0
Represents settings that affect the environment in which the WebScene is displayed (such as lighting). It is part of the initial state of the WebScene as well as Presentation.slides in the presentation.
- See also
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
| | ||
Background | null | undefined | | |
declaredClass readonly inherited | ||
| | ||
| | ||
| |
background
- Type
- Background | null | undefined
Specifies how the background of the scene (which lies behind sky, stars and atmosphere) should be displayed. By default this is simply a single, fully opaque, black color. Currently ColorBackground is the only type of background supported.
lighting
- Type
- SunLighting | VirtualLighting
Settings for defining the lighting of the scene. The lighting can be either "sun" or "virtual".
starsEnabled
- Type
- boolean
Indicates whether stars visualization is enabled.
- Default value
- true
weather
- Type
- WeatherUnion
Indicates the type of weather visualization in the scene. This setting does not have any effect in local scenes.
| Known Value | Example |
|---|---|
| SunnyWeather | ![]() |
| CloudyWeather | ![]() |
| RainyWeather | ![]() |
| SnowyWeather | ![]() |
| FoggyWeather | ![]() |
- Default value
- SunnyWeather
Methods
fromJSON
- Signature
-
fromJSON (json: any): any
Creates a new instance of this class and initializes it with values from a JSON object
generated from an ArcGIS product. The object passed into the input json
parameter often comes from a response to a query operation in the REST API or a
toJSON()
method from another ArcGIS product. See the Using fromJSON()
topic in the Guide for details and examples of when and how to use this function.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects. | |
- Returns
- any
Returns a new instance of this class.
clone
- Signature
-
clone (): Environment
Creates a deep clone of this object.
- Returns
- Environment
Creates a deep clone of the instance calling this method.
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.




