A graphic can only be associated with one layer. You have to clone your graphic object and then add it to your layer. Graphic clonedGraphic = new Graphic { Symbol = yourOldGraphic.Symbol, Geometry = Geometry.Clone(yourOldGraphic.Geometry), }; foreach (var attribute in yourOldGraphic.Attributes) clonedGraphic.Attributes.Add(attribute); layer.Graphics.Add(clonedGraphic); Hope this helps.
Graphic clonedGraphic = new Graphic { Symbol = yourOldGraphic.Symbol, Geometry = Geometry.Clone(yourOldGraphic.Geometry), }; foreach (var attribute in yourOldGraphic.Attributes) clonedGraphic.Attributes.Add(attribute); layer.Graphics.Add(clonedGraphic);
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.