Applies the current state of the map description to the map server object.
[Visual Basic 6.0] Sub ApplyMapDescription(
ByVal MapDescription As IMapDescription, _
ByVal mapDisplay As IImageDisplay _
)
[Visual Basic .NET] Public Sub ApplyMapDescription ( _ ByVal MapDescription As IMapDescription, _ ByVal mapDisplay As IImageDisplay _ )
[C#] public void ApplyMapDescription ( IMapDescription MapDescription, IImageDisplay mapDisplay );
[Java] public void applyMapDescription ( IMapDescription MapDescription, IImageDisplay mapDisplay ) throws IOException, AutomationException
[C++] HRESULT ApplyMapDescription( IMapDescription* MapDescription, IImageDisplay* mapDisplay );
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);
}
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.
Dim pMapServer As IMapServer2'Get custom graphics from MapDescription
Dim pCustomGraphics As IGraphicElements
Set pCustomGraphics = pMapDesc.CustomGraphics
'Access fine-grained ArcObjects
Dim pMapServerObj As IMapServerObjects2
Set pMapServerObj = pMapServer
Dim pMap As IMap
Set pMap = pMapServerObj.Map(pMapDesc.Name)
'QI to graphics container of map
Dim pGraphicsContainer As IGraphicsContainer
Set pGraphicsContainer = pMap
'Step through custom graphics and
'add them to graphics container of map
Dim i As Long
For i = 0 To pCustomGraphics.Count - 1
pGraphicsContainer.AddElement pCustomGraphics.Element(i), 0
Next i