I know this is a very simple question, however, I find it difficult to find an answer. How do I add an existing layer to my map using ArcGIS Pro SDK? I saw several examples where the layer is added while being created (for example

LayerFactory.Instance.CreateFeatureLayer(new Uri(strUri), map);

), however, how this is being done for, let's say, FeatureLayer from geodatabase?



There are lots of examples for how to do this in the help wiki. If you are trying to add a layer from a geodatabase then you would first create an object that references the gdb and then open the feature class. See here: ProConcepts Geodatabase


Thank you Rich Wawrzonek,

I have found the answer, so if anyone comes into this silly situation this is the answer:

LayerFactory.Instance.CopyLayer(sourceLayer, map);

Simple as that. Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.