<?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: Using the ArcGIS JS SDK, all calls I make to an Image Server Identify yield &amp;quot;Right side of assignment cannot be destructured&amp;quot; error in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-arcgis-js-sdk-all-calls-i-make-to-an/m-p/1540132#M85709</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/835558"&gt;@check-your-crs&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I think you likely just need to wait for the imageryLayer to load before you do the identify.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const url = 'https://ic.imagery1.arcgis.com/arcgis/rest/services/Sentinel2_10m_LandCover/ImageServer';
const imageryLayer = new ImageryLayer({
   url,
});

await imageryLayer.load();

const identity = await imageryLayer.identify({
   geometry: geometry: new Point({
      x: 0,
      y: 0,
      spatialReference: new SpatialReference({ wkid: 3857 }),
   }),
   returnCatalogItems: false,
   returnGeometry: false,
   returnPixelValues: true,
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://codepen.io/sagewall/pen/poXMjwa?editors=1010" target="_blank" rel="noopener"&gt;https://codepen.io/sagewall/pen/poXMjwa?editors=1010&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2024 19:38:42 GMT</pubDate>
    <dc:creator>Sage_Wall</dc:creator>
    <dc:date>2024-09-18T19:38:42Z</dc:date>
    <item>
      <title>Using the ArcGIS JS SDK, all calls I make to an Image Server Identify yield "Right side of assignment cannot be destructured" error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-arcgis-js-sdk-all-calls-i-make-to-an/m-p/1539575#M85705</link>
      <description>&lt;P&gt;I am trying to query an ArcGIS ImageServer (specifically &lt;A href="https://ic.imagery1.arcgis.com/arcgis/rest/services/Sentinel2_10m_LandCover/ImageServer" target="_self"&gt;Sentinel2&lt;/A&gt;) using the `ImageryLayer.identify()` &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html" target="_self"&gt;function&lt;/A&gt;. Every combination of parameters I've used leads to "TypeError: Right side of assignment cannot be destructured".&amp;nbsp;I found a StackOverflow &lt;A href="https://stackoverflow.com/questions/76018432/right-side-of-assignment-cannot-be-destructured" target="_self"&gt;thread&lt;/A&gt; about that error message.&lt;/P&gt;&lt;P&gt;Example code 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const url = 'https://ic.imagery1.arcgis.com/arcgis/rest/services/Sentinel2_10m_LandCover/ImageServer';
const imageryLayer = new ImageryLayer({
   url,
});
const identity = await imageryLayer.identify({
// Every combination of parameters, including none at all, leads to the same error.
   geometry: geometry: new Point({
      x: 0,
      y: 0,
      spatialReference: new SpatialReference({ wkid: 3857 }),
   }),
   returnCatalogItems: false,
   returnGeometry: false,
   returnPixelValues: true,
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This only happens when I create the `imageryLayer` from a URL, but not from an item ID. Doing that leads to a different error, but still independent of the parameters I use.&lt;/P&gt;&lt;P&gt;Example code 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const imageryLayer = new ImageryLayer({
   id: 'ITEM_ID_HERE',
});
// Keep everything else the same.
// This leads to the following error: `JSON Parse error: Unrecognized token '&amp;lt;'.`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This leads to the following error: "JSON Parse error: Unrecognized token '&amp;lt;'.&lt;/P&gt;&lt;P&gt;I also created a &lt;A href="https://stackoverflow.com/questions/78975090/using-the-arcgis-js-sdk-all-calls-i-make-to-an-image-server-identify-yield-rig" target="_self"&gt;question&lt;/A&gt; on StackOverflow for this.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 19:13:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-arcgis-js-sdk-all-calls-i-make-to-an/m-p/1539575#M85705</guid>
      <dc:creator>check-your-crs</dc:creator>
      <dc:date>2024-09-18T19:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using the ArcGIS JS SDK, all calls I make to an Image Server Identify yield "Right side of assignment cannot be destructured" error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-arcgis-js-sdk-all-calls-i-make-to-an/m-p/1540132#M85709</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/835558"&gt;@check-your-crs&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I think you likely just need to wait for the imageryLayer to load before you do the identify.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const url = 'https://ic.imagery1.arcgis.com/arcgis/rest/services/Sentinel2_10m_LandCover/ImageServer';
const imageryLayer = new ImageryLayer({
   url,
});

await imageryLayer.load();

const identity = await imageryLayer.identify({
   geometry: geometry: new Point({
      x: 0,
      y: 0,
      spatialReference: new SpatialReference({ wkid: 3857 }),
   }),
   returnCatalogItems: false,
   returnGeometry: false,
   returnPixelValues: true,
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://codepen.io/sagewall/pen/poXMjwa?editors=1010" target="_blank" rel="noopener"&gt;https://codepen.io/sagewall/pen/poXMjwa?editors=1010&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 19:38:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-arcgis-js-sdk-all-calls-i-make-to-an/m-p/1540132#M85709</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2024-09-18T19:38:42Z</dc:date>
    </item>
  </channel>
</rss>

