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?
<SPAN class="comment token">//This highlights my geometry on my main map</SPAN>
CIMStroke outline <SPAN class="operator token">=</SPAN> SymbolFactory<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ConstructStroke</SPAN><SPAN class="punctuation token">(</SPAN>CIMColor<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CreateRGBColor</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">50.0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">2.0</SPAN><SPAN class="punctuation token">,</SPAN> SimpleLineStyle<SPAN class="punctuation token">.</SPAN>Solid<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
CIMRGBColor BlueColor <SPAN class="operator token">=</SPAN> ColorFactory<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN>BlueRGB <SPAN class="keyword token">as</SPAN> CIMRGBColor<SPAN class="punctuation token">;</SPAN>
IDisposable disposable <SPAN class="operator token">=</SPAN> MapView<SPAN class="punctuation token">.</SPAN>Active<SPAN class="punctuation token">.</SPAN><SPAN class="token function">AddOverlay</SPAN><SPAN class="punctuation token">(</SPAN>inItem<SPAN class="punctuation token">.</SPAN>Geometry<SPAN class="punctuation token">,</SPAN> SymbolFactory<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ConstructPolygonSymbol</SPAN><SPAN class="punctuation token">(</SPAN>BlueColor<SPAN class="punctuation token">,</SPAN> SimpleFillStyle<SPAN class="punctuation token">.</SPAN>Solid<SPAN class="punctuation token">,</SPAN> outline<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">MakeSymbolReference</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//Get the map frame element of the layout that I use, and replace the map</SPAN>
<SPAN class="comment token">//This should have the disposable Overlay on it but it doesn't?</SPAN>
Layout layout <SPAN class="operator token">=</SPAN> LayoutProjectItem<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayout</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
MapFrame mapFrame <SPAN class="operator token">=</SPAN> layout<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FindElement</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"MapLayer"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> MapFrame<SPAN class="punctuation token">;</SPAN>
mapFrame<SPAN class="punctuation token">.</SPAN><SPAN class="token function">SetMap</SPAN><SPAN class="punctuation token">(</SPAN>inUserPrintInformation<SPAN class="punctuation token">.</SPAN>MapCopy<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">// Create PDF format with appropriate settings</SPAN>
PDFFormat PDF <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">PDFFormat</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
Resolution <SPAN class="operator token">=</SPAN> <SPAN class="number token">300</SPAN><SPAN class="punctuation token">,</SPAN>
OutputFileName <SPAN class="operator token">=</SPAN> inExportFileName
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>PDF<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ValidateOutputFilePath</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
LayoutProjectItem<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Export</SPAN><SPAN class="punctuation token">(</SPAN>PDF<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>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?