I am allowing my users to Export their polygons using a a form in which they select the polygon and hit export. This tool asks if the user would like to highlight the polygon with a certain color, and also buffer that polygon. The tool then exports a pdf layout or shows it on the screen. I have been able to allow for selection, load a saved layout, update the layout tags, move the camera, etc. This all happens in the background. However, when I try to add a selection overlay, or buffer overlay, it doesn't show up on the layout? I know I am adding the disposable overlay to the map, because I am not disposing it yet and I can see it?
//This highlights my geometry on my main map
CIMStroke outline = SymbolFactory.Instance.ConstructStroke(CIMColor.CreateRGBColor(0, 0, 0, 50.0), 2.0, SimpleLineStyle.Solid);
CIMRGBColor BlueColor = ColorFactory.Instance.BlueRGB as CIMRGBColor;
IDisposable disposable = MapView.Active.AddOverlay(inItem.Geometry, SymbolFactory.Instance.ConstructPolygonSymbol(BlueColor, SimpleFillStyle.Solid, outline).MakeSymbolReference());
//Get the map frame element of the layout that I use, and replace the map
//This should have the disposable Overlay on it but it doesn't?
Layout layout = LayoutProjectItem.GetLayout();
MapFrame mapFrame = layout.FindElement("MapLayer") as MapFrame;
// Create PDF format with appropriate settings
PDFFormat PDF = new PDFFormat()
Resolution = 300,
OutputFileName = inExportFileName
This code is just a snipped of all of my code, but i essentially want to add a overlay to the map and export it. But it doesn't seem to be on the exported map?