Skip to content

This sample shows how to add a SceneLayer with realistic textures to a Scene component. The SceneLayer is given an offset of 6 meters, to better align with the terrain.

const sceneLayer = new SceneLayer({
portalItem: {
id: "2342ab7928834076a1240fb93c60e978",
},
elevationInfo: {
mode: "absolute-height",
offset: 6,
},
});

The scene is made more realistic by enabling shadows and setting the lighting based on a specific time of day using the environment property of the Scene component.

viewElement.environment = {
lighting: {
date: new Date("July 15, 2015 8:00:00 PDT"),
directShadowsEnabled: true,
},
};

Other helpful resources