Realistic buildings with SceneLayer

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

1
2
3
4
5
6
7
8
9
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 SceneView.

1
2
3
4
5
6
view.environment = {
  lighting: {
    date: new Date("July 15, 2015 8:00:00 PDT"),
    directShadowsEnabled: true
  }
};

Other helpful resources

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

The developer dashboard has moved

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close