ArcObjects Library Reference (Carto)  

IMapServerObjects.ApplyMapDescription Method

Applies the current state of the map description to the map server object.

[Visual Basic .NET]
Public Sub ApplyMapDescription ( _
    ByVal MapDescription As IMapDescription, _
    ByVal mapDisplay As IImageDisplay _
)
[C#]
public void ApplyMapDescription (
    IMapDescription MapDescription,
    IImageDisplay mapDisplay
);
[C++]
HRESULT ApplyMapDescription(
  IMapDescription* MapDescription,
  IImageDisplay* mapDisplay
);
[C++]

Parameters

MapDescription [in]

  MapDescription is a parameter of type IMapDescription

mapDisplay [in]

  mapDisplay is a parameter of type IImageDisplay

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

Use ApplyMapDescription to apply changes made in IMapDescription2 to the map server object. ApplyMapDescription will not apply any custom graphics (IMapDescription2 or IPageDescription) to the map server object. See the following example on how to apply custom graphics to the map server object.

[C#]

The following sample code shows how to apply custom graphics set in IMapDescription to the fine-grained ArcObjects. It assumes that you already have a valid MapServer and MapDescription object.

IMapServer2 mapServer;
IMapDescription2 mapDesc;

// Get custom graphics from MapDescription
IGraphicElements customGraphics = mapDesc.CustomGraphics;

// Access fine-grained ArcObjects
IMapServerObjects2 mapServerObj = (IMapServerObjects)mapServer;
IMap map = mapServerObj.get_Map(mapDesc.Name);

// QI to graphics container of map
IGraphicsContainer graphicsContainter = (IGraphicsContainer)map;

// Step through custom graphics and
// add them to graphics container of map
for (int i = 0; i < customGraphics.Count; i++)
{
        IElement element = customGraphics.get_Element (i) as IElement;
        graphicsContainter.AddElement(element, 0);
}

See Also

IMapServerObjects Interface