<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: WebScene Slides not applying in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079048#M73875</link>
    <description>&lt;P&gt;Thanks John.&lt;/P&gt;&lt;P&gt;Really, this is the first time I've seen this, every example (&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/intro-sceneview/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/intro-sceneview/&lt;/A&gt;) I've seen does exactly that.&lt;/P&gt;&lt;P&gt;Can you furthur clarify what setup I should be using to make sure everything is ready to use?&lt;/P&gt;&lt;P&gt;map = new WebScene({...})&lt;/P&gt;&lt;P&gt;map.when( ()=&amp;gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;view = new SceneView({...})&lt;/P&gt;&lt;P&gt;&amp;nbsp;view.when( ()=&amp;gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; map.loadAll().then( () =&amp;gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;// Should be good now?&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp;});&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is the loadAll called internally? or should I be using map.loadAll.then() instead of map.when(... or Promise.all([map.when(), map.loadAll()]).then(...&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jul 2021 03:07:55 GMT</pubDate>
    <dc:creator>JethroLeevers</dc:creator>
    <dc:date>2021-07-15T03:07:55Z</dc:date>
    <item>
      <title>WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1075557#M73733</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been having issues with the WebScene slides.&lt;/P&gt;&lt;P&gt;It seems to be an issue with the visibleLayers properties of the slides not being populated.&lt;/P&gt;&lt;P&gt;Sometimes they work fine, other times the visibleLayers property contains no items and hence the slide does not appear to work when using the applyTo function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jethro&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 05:32:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1075557#M73733</guid>
      <dc:creator>JethroLeevers</dc:creator>
      <dc:date>2021-07-05T05:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1078135#M73834</link>
      <description>&lt;P&gt;I have still had no luck getting to the cause of this issue&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":downcast_face_with_sweat:"&gt;😓&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Could this be related to any of the layers timing out on start up? (Australian Internet)&lt;/P&gt;&lt;P&gt;Would also like to add that this is using a dojo built deployment&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 05:29:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1078135#M73834</guid>
      <dc:creator>JethroLeevers</dc:creator>
      <dc:date>2021-07-13T05:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1078497#M73851</link>
      <description>&lt;P&gt;Could it be that the web scene is not fully loaded before you try to call applyTo?&amp;nbsp; Do you have a very simple codepen showing the basic steps you're taking in your code?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 21:42:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1078497#M73851</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-07-13T21:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1078547#M73853</link>
      <description>&lt;P&gt;I don't think that is the case unless there is some other promise that i'm meant to be waiting for, I initialise my buttons to load the slides inside the view.when, this is also after map.when&lt;/P&gt;&lt;P&gt;I have made a pen that is similar to my setup but am unable to replicte the issue&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/leevers/pen/xxdgLBa" target="_blank"&gt;https://codepen.io/leevers/pen/xxdgLBa&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 05:41:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1078547#M73853</guid>
      <dc:creator>JethroLeevers</dc:creator>
      <dc:date>2021-07-14T05:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1078736#M73862</link>
      <description>&lt;P&gt;The 'when()' method tells us that the JS instance is ready to interact with in code.&amp;nbsp; You can use 'load()' or 'loadAll()' to ensure all of the resources that need to be loaded asynchronously are available.&amp;nbsp; Also, your code tries to create the SceneView outside of (before) the WebScene 'when()' call resolves.&amp;nbsp; In certain circumstances this will matter because even though the SceneView instance is ready, the WebScene resources you want to use might not be loaded.&amp;nbsp; Hopefully these small changes will help in your app.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/john-grayson/pen/BaRpbzY" target="_blank"&gt;https://codepen.io/john-grayson/pen/BaRpbzY&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 15:56:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1078736#M73862</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-07-14T15:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1078738#M73863</link>
      <description>&lt;P&gt;when you check the webscene json, are the visible layers in the slides or are they missing? For the example that you shared, they would look like this:&amp;nbsp;&lt;A href="https://aam-ags-demo-03.aamgeocloud.com/portal/sharing/rest/content/items/9a5c8855529c4109b53032084bf5bdb5/data?f=json&amp;amp;token=a2TZab0Q6tp99EXZtWrt1gwRDaNOZQ6hlPwBmTFoLgrRyCtNuTuFrPZJD6KeZohxkTUxzE8YdlO6bCJQ-JZHYp7o5kDZLk36GIsAG4U44PUmGGULLUohyyBQ3pRYDNv5AZW4Rgci6Uqn5COdJAVpcL0cnEVLHd4ykxZdwMvSPok" target="_blank"&gt;https://aam-ags-demo-03.aamgeocloud.com/portal/sharing/rest/content/items/9a5c8855529c4109b53032084bf5bdb5/data?f=json&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  "id": "177ff571076-slide-2",
  "title": {
    "text": "Sydney 7.5cm Photo Mesh Model 2020"
  },
  ...,
  "visibleLayers": [
    {
      "id": "17964079d27-layer-17"
    },
    {
      "id": "177fc6aa2cb-layer-0"
    }
  ]
},&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 16:00:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1078738#M73863</guid>
      <dc:creator>RalucaNicola1</dc:creator>
      <dc:date>2021-07-14T16:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079048#M73875</link>
      <description>&lt;P&gt;Thanks John.&lt;/P&gt;&lt;P&gt;Really, this is the first time I've seen this, every example (&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/intro-sceneview/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/intro-sceneview/&lt;/A&gt;) I've seen does exactly that.&lt;/P&gt;&lt;P&gt;Can you furthur clarify what setup I should be using to make sure everything is ready to use?&lt;/P&gt;&lt;P&gt;map = new WebScene({...})&lt;/P&gt;&lt;P&gt;map.when( ()=&amp;gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;view = new SceneView({...})&lt;/P&gt;&lt;P&gt;&amp;nbsp;view.when( ()=&amp;gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; map.loadAll().then( () =&amp;gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;// Should be good now?&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp;});&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is the loadAll called internally? or should I be using map.loadAll.then() instead of map.when(... or Promise.all([map.when(), map.loadAll()]).then(...&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 03:07:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079048#M73875</guid>
      <dc:creator>JethroLeevers</dc:creator>
      <dc:date>2021-07-15T03:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079050#M73876</link>
      <description>&lt;P&gt;Thanks Raluca,&lt;/P&gt;&lt;P&gt;The slides data always exist in the data url, they just dont seem to make it though to the slides.visibleLayers, the viewpoint, title and image are always populated.&lt;/P&gt;&lt;P&gt;Jethro&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 02:17:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079050#M73876</guid>
      <dc:creator>JethroLeevers</dc:creator>
      <dc:date>2021-07-15T02:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079155#M73884</link>
      <description>&lt;P&gt;So if you create a webscene and then set it on the view, the api internally calls the `load` method once it's set on the map property of the view. If then you call `webscene.when` that should run the callback you're passing exactly when the load method resolves.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const webscene = new WebScene(...);

const view = new SceneView({
  ...
  map: webscene
});

webscene.when(() =&amp;gt; {

// now you have access to layers, ground and basemap

});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The load method however, doesn't load all the loadable resources/sublayers etc. Slides might also not be ready depending on how heavy your scene is. So I'd advise you to use `loadAll()` to wait for all the resources like John showed in his example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;map.loadAll().then(() =&amp;gt; {

// the scene is now fully loaded and you can create the view, the slides, set properties on layers etc.
// you don't need map.when() anymore
// you can use view.when() if you want to make sure that the view is ready. In case you make changes before this point, they might get overriden when the map is set on the view.
})
.catch((err) =&amp;gt; console.log(err));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 11:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079155#M73884</guid>
      <dc:creator>RalucaNicola1</dc:creator>
      <dc:date>2021-07-15T11:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079236#M73889</link>
      <description>&lt;P&gt;'WebScene.when()' just tells you the JS instance is ready, so you can for example set it as the 'map' property of the SceneView.&amp;nbsp; It does not however tell us its internal properties that rely on asynchronous calls are ready, that is what the 'load()' and 'loadAll()' are for.&amp;nbsp; This follows the '&lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/#loadable" target="_self"&gt;loadable&lt;/A&gt;' pattern in the JS API.&amp;nbsp; That specific example doesn't show this pattern because it doesn't try to use WebScene properties before they're ready.&amp;nbsp; In your use-case, you're looking to modify layer properties and access the slides, and for this use-case you need to wait until the WebScene has retrieved and set these internal properties correctly.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 15:22:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079236#M73889</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-07-15T15:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079556#M73904</link>
      <description>&lt;P&gt;Thanks Raluca and John,&lt;/P&gt;&lt;P&gt;Waiting for loadAll to do anything give me a long wait before anything happens on screen.&lt;/P&gt;&lt;P&gt;Is the following a way to avoid this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const map = new WebScene({...});
const view = new SceneView({...}); // map not set
map.when( ()=&amp;gt;{
 view.map = map;
});
map.loadAll().then( ()=&amp;gt;{
 // Good to do change layer properties now? e.g. listMode, popupEnabled, outFields
 view.when( ()=&amp;gt; {
  // All good to do anything
 });
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Jethro&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 02:14:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079556#M73904</guid>
      <dc:creator>JethroLeevers</dc:creator>
      <dc:date>2021-07-16T02:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: WebScene Slides not applying</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079689#M73910</link>
      <description>&lt;P&gt;Instead of 'loadAll()' you can also target specific properties. Try 'load()' and and see if the internal Web Scene properties you want to access/change are available.&amp;nbsp; You can also try the various methods available via 'watchUtils' to discover when specific properties are defined or changed.&amp;nbsp; Also, if wanting to modify layer properties that are loaded asynchronously you can use the 'load()' method for only the layers&amp;nbsp; you need to modify.&amp;nbsp; Here is one of many approaches you could take depending on the application and web scene content.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const map = new WebScene({...});

// slides are part of the web scene [not tested] //
watchUtils.whenDefined(map, 'presentation', presentation =&amp;gt;{
  if(presentation &amp;amp;&amp;amp; presentation.slides){
    // do something with slides now that they're available...
  }
});

const view = new SceneView({
  map: map
});
view.when(()=&amp;gt; {
  view.map.layers.forEach(layer =&amp;gt; {
    if(listOfLayersToChange.includes(layer.title)){
      // only wait for load of specific layers you need to change
      layer.load().then(()=&amp;gt;{
        // change layer settings that were loaded asyncronously
      });
    }
  });
});

&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 15:31:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webscene-slides-not-applying/m-p/1079689#M73910</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-07-16T15:31:56Z</dc:date>
    </item>
  </channel>
</rss>

