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);
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.