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
Sandbox image
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>
I'm not able to view the scene because you're loading it from an on premise portal. The code looks good. The only thing that may be an issue is the fact that you're using 4.0beta3, not 4.0. Switch out the version for 4.0 and see what happens. I don't expect much of a different result, but that could be an issue.
This may be more specific to the layer. Can you give some more description? Is it a FeatureLayer or a SceneLayer? Is the renderer saved to the service, or do you customize it in the scene? I can look for a similar layer and try to reproduce the issue you're having.