< meta name = "viewport" content = "width=device-width, initial-scale=1, shrink-to-fit=no" />
< title >Intro to SceneLayer | Sample | ArcGIS Maps SDK for JavaScript</ title >
<!-- Load the ArcGIS Maps SDK for JavaScript from CDN -->
< script type = "module" src = "https://js.arcgis.com/5.1/" ></ script >
basemap = "dark-gray-vector"
camera-position = "-74.0338, 40.6913, 707"
< arcgis-zoom slot = "top-left" ></ arcgis-zoom >
< arcgis-navigation-toggle slot = "top-left" ></ arcgis-navigation-toggle >
< arcgis-compass slot = "top-left" > </ arcgis-compass >
const SceneLayer = await $arcgis . import ( "@arcgis/core/layers/SceneLayer.js" );
// Get a reference to the Scene component
const viewElement = document . querySelector ( "arcgis-scene" );
// Create a SceneLayer instance
const sceneLayer = new SceneLayer ({
id : "2e0761b9a4274b8db52c4bf34356911e" ,
// Create a MeshSymbol3D for symbolizing the SceneLayer
type : "mesh-3d" , // autocasts as new MeshSymbol3D()
type : "fill" , // autocasts as new FillSymbol3DLayer()
// If the value of material is not assigned, the default color will be grey
// Wait for the view to initialize
await viewElement . viewOnReady ();
// Add the SceneLayer to the map
viewElement . map . add ( sceneLayer );
// Add the renderer to the SceneLayer
type : "simple" , // autocasts as new SimpleRenderer()