UMD JS API Workshop
Exercise 6 3D - Create a 3D Application from a Web Scene

Instructions:

You can use the ArcGIS API for JavaScript to easily load web scenes built with the Scene Viewer. The advantage to using this approach is that the app will inherit all of the pre-defined settings you configured in your portal.

Exercise:

1. Update Require Statement
Let's first add a reference for our WebScene in our require statement and include it in our function parameters.

"esri/WebScene"

2. Add Scene Layer
The scene we are going to loading in is located here!

Note the scene ID at the end of that URL. Take the code block below, paste this above the view variable, and then paste in that same ID into the proper space of the portalItem.

var scene = new WebScene({
  portalItem: {
    id: ""
  }
});



3. Switch out map for scene
This one is easy. In the previous step we created a variable called "scene". Simply replace the "map" variable in our view with this new scene variable!

We can also now delete the "center" and "scale" items in our view as this is defined in our Web Scene.






Challenges:

Find your own Web Scene and load it in! Use that same method to find the ID of your scene.