<?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: Find layer which invokes popup in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layer-which-invokes-popup/m-p/1241609#M79652</link>
    <description>&lt;P&gt;You can probably do this a couple of ways, but one would be using the reactive utils.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can watch visible prop of the popup, then the selectedFeature, and check the layer the feature comes from.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;watch(
  () =&amp;gt; view.popup.visible,
  () =&amp;gt; {
    watch(
      () =&amp;gt; view.popup.selectedFeature,
      (selectedFeature) =&amp;gt; console.log("Source layer", selectedFeature.layer),
      { once: true }
    );
  }
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a sample showing how you can use it.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/GRGVBgr?editors=1000" target="_blank"&gt;https://codepen.io/odoe/pen/GRGVBgr?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You don't even need to watch the Popup visible, and just watch the selectedFeature, but if you paginate, it wouldn't always be the one that opened the popup.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Dec 2022 17:08:56 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2022-12-15T17:08:56Z</dc:date>
    <item>
      <title>Find layer which invokes popup</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layer-which-invokes-popup/m-p/1241454#M79651</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have different types of layers added to my map, How can I find which layer has invoked the popup, I am using watchUtils to find when when the popup is visible, but I am unable to find which layers has invoked the popup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;watchUtils.when(view.popup, "visible", function(evt){
       //Code
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I am using Arcgis Javascript 4.24 version. kindly guide me how can I find the layer info&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 04:52:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layer-which-invokes-popup/m-p/1241454#M79651</guid>
      <dc:creator>NatAlex</dc:creator>
      <dc:date>2022-12-15T04:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Find layer which invokes popup</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layer-which-invokes-popup/m-p/1241609#M79652</link>
      <description>&lt;P&gt;You can probably do this a couple of ways, but one would be using the reactive utils.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can watch visible prop of the popup, then the selectedFeature, and check the layer the feature comes from.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;watch(
  () =&amp;gt; view.popup.visible,
  () =&amp;gt; {
    watch(
      () =&amp;gt; view.popup.selectedFeature,
      (selectedFeature) =&amp;gt; console.log("Source layer", selectedFeature.layer),
      { once: true }
    );
  }
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a sample showing how you can use it.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/GRGVBgr?editors=1000" target="_blank"&gt;https://codepen.io/odoe/pen/GRGVBgr?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You don't even need to watch the Popup visible, and just watch the selectedFeature, but if you paginate, it wouldn't always be the one that opened the popup.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 17:08:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layer-which-invokes-popup/m-p/1241609#M79652</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-12-15T17:08:56Z</dc:date>
    </item>
  </channel>
</rss>

