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);
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.