<?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 Selecting features within a SceneLayerView by graphic in an experience builder custom widget in Experience Builder Custom Widgets</title>
    <link>https://community.esri.com/t5/experience-builder-custom-widgets/selecting-features-within-a-scenelayerview-by/m-p/1374321#M178</link>
    <description>&lt;P&gt;I am trying to create a widget where a user can select one or multiple features in a scene layer using a graphic that thay have draw, so either a point or a polygon. These selected features will also be highlighted once selected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have largely been following the sample code in this link&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/layers-scenelayerview-query-stats/" target="_blank" rel="noopener"&gt;SceneLayerView - query statistics by geometry&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The error I am getting, is that when I am creating the view of the scene layer, the sceneLayerView seems to be null/ is not initializing properly and hence is not being queried. Any help would be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const graphicsLayer = new GraphicsLayer()
jmv.view.map.add(graphicsLayer)
console.log("debug message B")

let sceneLayer = null;
let sceneLayerView = null;

//Assign scenelayer once scene layer is loaded
const map = jmv.view.map;
console.log("debug message D")

sceneLayer = map.layers.find((layer) =&amp;gt; {
    return layer.title === "1612_GF_PGM"
});

console.log(sceneLayer.type)

sceneLayer.outfields = ["label", "elevation"]

console.log("initalialising sceneLayerView")
console.log(sceneLayer.title)

jmv.whenJimuLayerViewLoaded(sceneLayer).then((layerView) =&amp;gt; {
    sceneLayerView = layerView
    console.log(sceneLayerView)
});
           &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jan 2024 12:06:02 GMT</pubDate>
    <dc:creator>IsobelMcLees</dc:creator>
    <dc:date>2024-01-25T12:06:02Z</dc:date>
    <item>
      <title>Selecting features within a SceneLayerView by graphic in an experience builder custom widget</title>
      <link>https://community.esri.com/t5/experience-builder-custom-widgets/selecting-features-within-a-scenelayerview-by/m-p/1374321#M178</link>
      <description>&lt;P&gt;I am trying to create a widget where a user can select one or multiple features in a scene layer using a graphic that thay have draw, so either a point or a polygon. These selected features will also be highlighted once selected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have largely been following the sample code in this link&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/layers-scenelayerview-query-stats/" target="_blank" rel="noopener"&gt;SceneLayerView - query statistics by geometry&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The error I am getting, is that when I am creating the view of the scene layer, the sceneLayerView seems to be null/ is not initializing properly and hence is not being queried. Any help would be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const graphicsLayer = new GraphicsLayer()
jmv.view.map.add(graphicsLayer)
console.log("debug message B")

let sceneLayer = null;
let sceneLayerView = null;

//Assign scenelayer once scene layer is loaded
const map = jmv.view.map;
console.log("debug message D")

sceneLayer = map.layers.find((layer) =&amp;gt; {
    return layer.title === "1612_GF_PGM"
});

console.log(sceneLayer.type)

sceneLayer.outfields = ["label", "elevation"]

console.log("initalialising sceneLayerView")
console.log(sceneLayer.title)

jmv.whenJimuLayerViewLoaded(sceneLayer).then((layerView) =&amp;gt; {
    sceneLayerView = layerView
    console.log(sceneLayerView)
});
           &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 12:06:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/experience-builder-custom-widgets/selecting-features-within-a-scenelayerview-by/m-p/1374321#M178</guid>
      <dc:creator>IsobelMcLees</dc:creator>
      <dc:date>2024-01-25T12:06:02Z</dc:date>
    </item>
  </channel>
</rss>

