AnsweredAssumed Answered

AddOverlay Polygon with Label

Question asked by mjk5000 on Jun 13, 2018
Latest reply on Jun 13, 2018 by UHarano-esristaff

I am wondering if it is possible to add an Overlay to a geometry, but either keep that underlying Geometry's label, or add a label to the overlay.  Since I am adding an overlay based on a unique attribute of a layer, I need to show the ID of that underlying layer. 

 

I use this code to add an overlay, but I really need to either retain the underlying label, or better yet, add a label overlay too.  Any Ideas?

 

Geometry MergedMATGeometries = FeatureServiceManagement.MergeSearchedGeometry("LayerName", "AttributeName", "AttributeValue");
          
CIMStroke solid = SymbolFactory.Instance.ConstructStroke(CIMColor.CreateRGBColor(255, 0, 0, 50.0), 1.0, SimpleLineStyle.Solid);

CIMColor RandomColor = GetRandomColor();

IDisposable disp = mapView.AddOverlay(MergedMATGeometries,                                                       
     SymbolFactory.Instance.ConstructPolygonSymbol(RandomColor, SimpleFillStyle.Solid,
          solid).MakeSymbolReference());

//I need to add a label to the above AddOverlay, 

Outcomes