How to Clone EncLayer

345
3
06-24-2020 05:57 AM
davidcuthbert
New Contributor

I am having issues creating a clone of an EncLayer.

Calling .Clone on the EncLayer raises an InvalidOperation exception with the message "Cannot call this method in this context: ENC data sources cannot be cloned"

Is there a context where this is possible or some other way to create the clone?

WPF application with runtime 100.8 using VS2019 C#.

Regards

0 Kudos
3 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Clone wasn't implemented for ENC Layer because it's a special layer type. Being closely tied to the underlying ENC Cell data, the properties are get-only and are read from the data at runtime rather than being loaded into memory. Any override-able properties are controlled via the global EncEnvironmentSettings object to ensure the display of all ENC content in the view is consistent.

Can you tell us more about why you want to clone the layer? (perhaps we missed a use case in our design)

Thanks

Mike

0 Kudos
davidcuthbert
New Contributor

Hi,

Thanks for the reply, I take it from the answer that there is no context in which Clone will work. OK, let me explain what our use case is.

We give our users the ability to swap between the 2D and 3D maps (MapView and SceneView). Clone  is used to duplicate the layers in each view as they often can't be shared.

We were trying to do the same with the ENC layers.

I have noticed in 3D view that not all the features show, so maybe showing this in 3D is not such a good idea anyway.

Regards

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

ENC Layers are currently only supported in 2D / MapView. However I could not see that information in the documentation and I have submitted an issue for our doc team to add this note.

Thanks

Mike  

0 Kudos