AnsweredAssumed Answered

Cannot visualize multipatch of my webscene via the API for JavaScript 4.0

Question asked by valraa on May 6, 2016
Latest reply on May 6, 2016 by KEkenes-esristaff


I am trying to use the ArcGIS API for JavaScript ver. 4 to visualize a web scene saved on my portal.

Anyway, I can see the basemap correctly displaying on my Elevation Layer, but I can't see the multipatch geometriy of the scene (which is actually the only feature layer of the scene, and is made of only a dozen of features).

The id of the webscene I need to access is taken from the URL of the scene when it is opened in the Portal (8499ccc34ba5477daecc5972a073f2f6).

The scene is saved to my Portal for ArcGIS 10.4 (it was published from ArcGIS Pro 1.2) and I can correctly see it in the scene viewer of the Portal.

These are the screenshots of the Portal and sandbox, while below is the code I am trying in the "sandbox" is the following:

Portal image

 

webscene_PORTAL.JPG

Sandbox image

webscene_API.JPG

 

CODE

 

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
  <title>Load a basic WebScene - 4.0beta3</title>
  <style>
    html,
    body {
    margin: 0;
    padding: 0;
    }
  </style>
  <link rel="stylesheet" href="https://js.arcgis.com/4.0beta3/esri/css/main.css">
  <script src="https://js.arcgis.com/4.0beta3/"></script>
  <script>
    require([
      "esri/views/SceneView",
      "esri/portal/PortalItem",
      "esri/WebScene",
      "esri/config",
      "dojo/domReady!"
    ], function(
      SceneView, PortalItem, WebScene, esriConfig
    ) {
      esriConfig.portalUrl = "https://otvserver07.one-team.local/arcgis";
      // The clipping extent for the scene
      var bormioExtent = { // autocasts as new Extent()
        xmax: 1160305.123320753,
        xmin: 1146868.2648745452,
        ymax: 5861740.971355474,
        ymin: 5850313.643078676,
        spatialReference: { // autocasts as new SpatialReference()
          wkid: 3857
        }
      };
      var scene = new WebScene({
        portalItem: new PortalItem({
          id: "8499ccc34ba5477daecc5972a073f2f6"
        }),
        clippingArea: bormioExtent,
        clippingEnabled: true
      }); 
      var view = new SceneView({
        map: scene,
        container: "viewDiv"
      });
    });
  </script>
</head>
<body>
  <div id="viewDiv"></div>
</body>
</html>

Outcomes