Select to view content in your preferred language

Using the ArcGIS JS SDK, all calls I make to an Image Server Identify yield "Right side of assignment cannot be destructured" error

9
0
yesterday
check-your-crs
New Member

I am trying to query an ArcGIS ImageServer (specifically Sentinel2) using the `ImageryLayer.identify()` function. Every combination of parameters I've used leads to "TypeError: Right side of assignment cannot be destructured". I found a StackOverflow thread about that error message.

Example code 1

 

 

 

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,
});

 

 

 

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.

Example code 2

 

 

 

const imageryLayer = new ImageryLayer({
   id: 'ITEM_ID_HERE',
});
// Keep everything else the same.
// This leads to the following error: `JSON Parse error: Unrecognized token '<'.`

 

 

 

 This leads to the following error: "JSON Parse error: Unrecognized token '<'.

 

I also created a question on StackOverflow for this.

0 Kudos
0 Replies