Esri / esri-loader

A tiny library to help load ArcGIS API for JavaScript modules in non-Dojo applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sublayer.clone() is not performing a deep clone

sasteigerwald opened this issue · comments

Expected behavior

  • When using sublayer.clone() in previous versions, ir performed a deep clone, this no longer happens
  • I need to perform a deep clone on sublayers so that I do not affect the sublayer directly when used for applying a definition expression and sending to a queryFeatures request
  • Angular 9, ArcGIS JavaScript API 4.15

Actual behavior

  • sublayer.clone() is NOT creating a deep clone. For example, the .url attribute is blank and I assume others are as well. Performing a previously working query against the sublayer no longer works or recognizes the clone as a sublayer.

Steps to reproduce the behavior

const combinedLayer: __esri.Sublayer = (<__esri.MapImageLayer>activeLayers[entity][0].layer).sublayers.toArray()[0].clone();
console.log(combinedLayer.url);

We can only help you if we're able to easily reproduce the behavior you describe above.

To me this sounds like this is a potential issue to raise with ArcGIS API for JavaScript rather than esri-loader. Are you referring to this method, and are you saying it worked as you expected prior to v4.15?

Yes, it worked as expected prior to 4.15. I will contact ESRI directly regarding the issue, thanks! There appears to be several issues with the Sublayer object that I am finding.

Closing this as it is not related to this library