<?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: Identify not honoring layerIds supplied to IdentifyParameters in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-not-honoring-layerids-supplied-to/m-p/1137516#M76101</link>
    <description>&lt;P&gt;This bug in 4.22 is related to the new &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#sublayers" target="_self"&gt;IdentifyParameters.sublayers&lt;/A&gt; property &lt;A href="https://developers.arcgis.com/javascript/latest/release-notes/#updates-to-identify-operation" target="_self"&gt;added in 4.22&lt;/A&gt;.&amp;nbsp; The way they've implemented it, &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#layerIds" target="_self"&gt;layerIds&lt;/A&gt; will be ignored if you do not supply a value for &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#sublayers" target="_self"&gt;sublayers&lt;/A&gt;.&amp;nbsp; Nonetheless, this is very easy to work around if you don't want to wait until 4.23 is released.&lt;/P&gt;&lt;P&gt;If you're identifying against a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html" target="_self"&gt;MapImageLayer&lt;/A&gt;, as is the case in &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=identify" target="_self"&gt;the sample&lt;/A&gt;, you can simply set the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html" target="_self"&gt;IdentifyParameters&lt;/A&gt; instance's &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#sublayers" target="_self"&gt;sublayers&lt;/A&gt; property to the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html" target="_self"&gt;MapImageLayer&lt;/A&gt; instance's &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers" target="_self"&gt;sublayers&lt;/A&gt; property.&amp;nbsp; In this case, I did this on line 85:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        // Executes each time the view is clicked
        function executeIdentify(event) {
          // Set the geometry to the location of the view click
          params.sublayers = identifyLayer.sublayers; //added line
          params.geometry = event.mapPoint;
          params.mapExtent = view.extent;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Technically, to make this work as desired, all that's required is to at minimum supply an array containing a single object having an "id" property that matches a value in what you're supplying for &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#layerIds" target="_self"&gt;layerIds&lt;/A&gt;:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        // Executes each time the view is clicked
        function executeIdentify(event) {
          // Set the geometry to the location of the view click
          params.sublayers = [{id:params.layerIds[0]}]; //added line
          params.geometry = event.mapPoint;
          params.mapExtent = view.extent;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jan 2022 18:15:30 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2022-01-26T18:15:30Z</dc:date>
    <item>
      <title>Identify not honoring layerIds supplied to IdentifyParameters</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-not-honoring-layerids-supplied-to/m-p/1131554#M75835</link>
      <description>&lt;P&gt;Refer to the Esri sample&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/identify/live/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/identify/live/.&amp;nbsp;&lt;/A&gt;which is based on&amp;nbsp;&lt;STRONG&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt;&amp;nbsp;*&amp;nbsp;&lt;SPAN class=""&gt;as&lt;/SPAN&gt;&amp;nbsp;identify&amp;nbsp;&lt;SPAN class=""&gt;from&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class=""&gt;"@arcgis/core/rest/identify"&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In the above sample, change the line number 70.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;From:
params.layerIds = [0, 1, 2, 3, 4];
To:
params.layerIds = [0];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, layer id &lt;STRONG&gt;0&lt;/STRONG&gt; represents &lt;STRONG&gt;Roads&lt;/STRONG&gt; layer. After the above code change, Identify should work only on Road layer, but it's not the case here.&lt;/P&gt;&lt;P&gt;Additional observation is, for &lt;STRONG&gt;payload&lt;/STRONG&gt; of the network transaction, could not see the provided layer ids at all. Refer to the below screenshot.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ranga_Tolapi_0-1641556931003.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/30990iA380291409DAF3EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ranga_Tolapi_0-1641556931003.png" alt="Ranga_Tolapi_0-1641556931003.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 12:10:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-not-honoring-layerids-supplied-to/m-p/1131554#M75835</guid>
      <dc:creator>Ranga_Tolapi</dc:creator>
      <dc:date>2022-01-07T12:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Identify not honoring layerIds supplied to IdentifyParameters</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-not-honoring-layerids-supplied-to/m-p/1131607#M75839</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10933"&gt;@Ranga_Tolapi&lt;/a&gt;,&amp;nbsp;this is a known issue that will be fixed at the next release (4.23). It should also be ready to test on &lt;STRONG&gt;next&lt;/STRONG&gt; soon:&amp;nbsp;&lt;A href="https://github.com/Esri/feedback-js-api-next" target="_blank"&gt;https://github.com/Esri/feedback-js-api-next&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 15:09:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-not-honoring-layerids-supplied-to/m-p/1131607#M75839</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-01-07T15:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Identify not honoring layerIds supplied to IdentifyParameters</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-not-honoring-layerids-supplied-to/m-p/1137516#M76101</link>
      <description>&lt;P&gt;This bug in 4.22 is related to the new &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#sublayers" target="_self"&gt;IdentifyParameters.sublayers&lt;/A&gt; property &lt;A href="https://developers.arcgis.com/javascript/latest/release-notes/#updates-to-identify-operation" target="_self"&gt;added in 4.22&lt;/A&gt;.&amp;nbsp; The way they've implemented it, &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#layerIds" target="_self"&gt;layerIds&lt;/A&gt; will be ignored if you do not supply a value for &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#sublayers" target="_self"&gt;sublayers&lt;/A&gt;.&amp;nbsp; Nonetheless, this is very easy to work around if you don't want to wait until 4.23 is released.&lt;/P&gt;&lt;P&gt;If you're identifying against a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html" target="_self"&gt;MapImageLayer&lt;/A&gt;, as is the case in &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=identify" target="_self"&gt;the sample&lt;/A&gt;, you can simply set the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html" target="_self"&gt;IdentifyParameters&lt;/A&gt; instance's &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#sublayers" target="_self"&gt;sublayers&lt;/A&gt; property to the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html" target="_self"&gt;MapImageLayer&lt;/A&gt; instance's &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#sublayers" target="_self"&gt;sublayers&lt;/A&gt; property.&amp;nbsp; In this case, I did this on line 85:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        // Executes each time the view is clicked
        function executeIdentify(event) {
          // Set the geometry to the location of the view click
          params.sublayers = identifyLayer.sublayers; //added line
          params.geometry = event.mapPoint;
          params.mapExtent = view.extent;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Technically, to make this work as desired, all that's required is to at minimum supply an array containing a single object having an "id" property that matches a value in what you're supplying for &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-IdentifyParameters.html#layerIds" target="_self"&gt;layerIds&lt;/A&gt;:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        // Executes each time the view is clicked
        function executeIdentify(event) {
          // Set the geometry to the location of the view click
          params.sublayers = [{id:params.layerIds[0]}]; //added line
          params.geometry = event.mapPoint;
          params.mapExtent = view.extent;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 18:15:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-not-honoring-layerids-supplied-to/m-p/1137516#M76101</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2022-01-26T18:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Identify not honoring layerIds supplied to IdentifyParameters</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-not-honoring-layerids-supplied-to/m-p/1137765#M76117</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;, your workaround worked like a charm&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 03:37:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/identify-not-honoring-layerids-supplied-to/m-p/1137765#M76117</guid>
      <dc:creator>Ranga_Tolapi</dc:creator>
      <dc:date>2022-01-27T03:37:42Z</dc:date>
    </item>
  </channel>
</rss>

