<?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 Return graphics from mulitiple layers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-graphics-from-mulitiple-layers/m-p/1571023#M86290</link>
    <description>&lt;P&gt;I have an onclick function, but it is tied to one layer. How can i make it so that i can use multiple layers?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.on ("click", function (event)
            {
                // Handle feature selection here
                console.log ("Get Selected Features Data")
                $ ('#customWindow').jqxWindow ('close');
                 $ ('#assignedEmployeesTable').jqxGrid ('clear')        
                view.hitTest (event).then (function (response)
                {
                    if (response.results.length &amp;gt; 0) {
                        const features = response.results.filter (function (result)
                        {
                            return result.graphic.layer === roomsUseLayer;// Filter for your specific layer
                        });

                        // Extract attributes from the selected features
                        features.forEach (function (feature)
                        {
                            attributes = feature.graphic.attributes;
                            console.log (attributes.SPACEID);
                            
                        });
                        getSpaceObjectID ();
                    }
                });
            });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Dec 2024 19:19:27 GMT</pubDate>
    <dc:creator>Mr_Kirkwood</dc:creator>
    <dc:date>2024-12-23T19:19:27Z</dc:date>
    <item>
      <title>Return graphics from mulitiple layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-graphics-from-mulitiple-layers/m-p/1571023#M86290</link>
      <description>&lt;P&gt;I have an onclick function, but it is tied to one layer. How can i make it so that i can use multiple layers?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.on ("click", function (event)
            {
                // Handle feature selection here
                console.log ("Get Selected Features Data")
                $ ('#customWindow').jqxWindow ('close');
                 $ ('#assignedEmployeesTable').jqxGrid ('clear')        
                view.hitTest (event).then (function (response)
                {
                    if (response.results.length &amp;gt; 0) {
                        const features = response.results.filter (function (result)
                        {
                            return result.graphic.layer === roomsUseLayer;// Filter for your specific layer
                        });

                        // Extract attributes from the selected features
                        features.forEach (function (feature)
                        {
                            attributes = feature.graphic.attributes;
                            console.log (attributes.SPACEID);
                            
                        });
                        getSpaceObjectID ();
                    }
                });
            });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 19:19:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-graphics-from-mulitiple-layers/m-p/1571023#M86290</guid>
      <dc:creator>Mr_Kirkwood</dc:creator>
      <dc:date>2024-12-23T19:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Return graphics from mulitiple layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-graphics-from-mulitiple-layers/m-p/1572903#M86332</link>
      <description>&lt;P&gt;The code below works as a solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.on("click", function (event) {
    // Handle feature selection here
    console.log("Get Selected Features Data")
    view.hitTest(event).then(function (response) {
        for (let i = 0; i &amp;lt; response.results.length; i++) {
            const result = response.results[i];
            const graphic = result.graphic;
            attributes = graphic.attributes;
            const layer = result.layer;
            console.log("Layer:", layer.title);
            console.log("Attributes:", attributes);
            console.log(attributes.OBJECTID)
            getObjectID();
        }
    });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 15:26:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/return-graphics-from-mulitiple-layers/m-p/1572903#M86332</guid>
      <dc:creator>Mr_Kirkwood</dc:creator>
      <dc:date>2025-01-08T15:26:54Z</dc:date>
    </item>
  </channel>
</rss>

