1

I'm having an issue with our ArcObjects code for exporting a map to PDF. There is a section of code that adds graphics on to the map (polygons, lines, text etc). This seems to work fine for the first map generated after the map service is started, but on subsequent prints the markup does not get displayed on the map. This code worked previously but no we've converted it to run as an SOE on ArcGIS Server 10.0.

The code in question:

        // IMap map, IGraphicElements graphicElements

        GraphicUtil.GetGraphicsContainer(map).DeleteAllElements(); // clear any previous markup

        _logger.Debug("Add graphic elements to container");
        IGraphicsContainer graphicsContainer = GetGraphicsContainer(map);
        graphicsContainer.Reset();
        for (int i = 0; i < graphicElements.Count; i++)
        {
            IElement element = graphicElements.get_Element(i) as IElement;
            _logger.Debug("Adding geometry type: " + element.Geometry.GeometryType.ToString());
            graphicsContainer.AddElement(element, 0);
        }

        ((IActiveView)map).PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);

    ...

    public static IGraphicsContainer GetGraphicsContainer(IMap map)
    {
        return (IGraphicsContainer)map;
    }

If I take out the DeleteAllElements the markup stays on the map between requests but any new markup doesn't get added. If I restart the map service, then it will add the markup on the next request, then not add anything after that.

In the ArcGIS Server logs I can see the following items which indicates nothing is being drawn, even though the graphic elements have been correctly added to the graphics container in the code (as far as I can tell)

INFO3   End of the graphics drawing.
INFO3   Graphic count: 0.
INFO3   Beginning of the graphics drawing.

Any suggestions would be much appreciated!

  • Are there any layers with transparency applied? – GeoGhost Nov 13 '13 at 16:43
  • no transparency – Rowan Nov 13 '13 at 23:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.