Graphic Layer - Pro making clone on just added graphic

184
0
11-15-2020 06:02 PM
ThanHtetAung_EsriAu
Esri Regular Contributor

Hi Guys,

In ArcGIS pro 2.6, in my maptool, 

I add the graphicslayer (if not in the map), and add the element after polygon is drawn.

https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-GraphicsLayers#targetgraphicslayer

Everything working smoothly and polygon graphic is added into the graphiclayer.

Code snippet.

await QueuedTask.Run(() =>
            {
                polygonSymbol = SymbolFactory.Instance.ConstructPolygonSymbol();
                polygonGraphic.Polygon = (Polygon)geometry;
                polygonGraphic.Symbol = polygonSymbol.MakeSymbolReference();

                this._PolygonGraphicsLayer.AddElement(polygonGraphic);
            });
//stop the user to keep on drawing another, deactivate the current maptool by activating other tool
 await FrameworkApplication.SetCurrentToolAsync(DAML.Tool.esri_mapping_exploreTool);

            await FrameworkApplication.SetCurrentToolAsync(DAML.Tool.esri_layouts_selectByRectangleTool);

 

But I noticed that if I move or edit the latest added graphic, it always create new graphic in the graphic layer.

 

It seem to be a bug in sdk or Pro?

Any idea @Wolf , @UmaHarano 

0 Kudos
0 Replies