Skip to content

Latest commit

 

History

History
58 lines (43 loc) · 2.66 KB

File metadata and controls

58 lines (43 loc) · 2.66 KB

###Exercise 5, Add a Scene Layer to a 3D map

This lab covers the basics of adding a scene layer to your application.

To learn more about what options you have with SceneLayers look at the SceneLayer API Reference

  1. Click create_starter_map_3d/index.html and copy the contents to a new jsbin.com.

  2. In JSBin > HTML, update the require statement and function definition:

    require([
      "esri/Map",
      "esri/views/SceneView",
      "esri/layers/SceneLayer",
      "dojo/domReady!"
    ], function(Map, SceneView, SceneLayer) {
  1. Now let's add the buildings scene layer to the map:
  var buildingsSL = new SceneLayer({
        url: "https://tiles.arcgis.com/tiles/0p6i4J6xhQas4Unf/arcgis/rest/services/New_York_City_3D_Buildings_Optimized/SceneServer"
      });

      var map = new Map({
        basemap: "dark-gray-vector",
        ground: "world-elevation",
        layers: [buildingsSL]
      });
  1. The JSBin Output panel should show a 3D view of earth that you can rotate around and zoom in on Manhatten to see the 3D buildings.

  2. Since we are focused on New York City, modify the SceneView to be zoomed in more and tilt the scene since we are looking at 3D data. Take a look at the SceneView and the Camera

        var view = new SceneView({
          container: "viewDiv",
          map: map,
          camera:{
            position: [-74.022468, 40.699343, 790],
            tilt: 71.47,
            heading: 30.25
          }
        });

Your app should look something like this:

###Bonus