This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IM > IMapServerObjects2 Interface > IMapServerObjects2.ApplyMapDescription Method (ArcObjects .NET 10.4 SDK) |
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
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.
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);
}