Provides access to members that control the globe drawing order.
Product Availability
Description
IGlobeDrawingOrder Provides access to the layer drawing order. The methods, Movebackward, MoveForward, MoveToBack, and MoveToFront allow re-ordering of layers relative to each other from current drawing order, stored as OrderedLayers.
Members
Description | ||
---|---|---|
MoveBackward | Moves a layer backward one position within the drawing order. | |
MoveForward | Moves a layer forward one position within the drawing order. | |
MoveRanks | Moves layers within the drawing order. | |
MoveToBack | Moves a layer to the back of the drawing order. | |
MoveToFront | Moves a layer to the front of the drawing order. | |
MoveToLayer | Moves a layer within the drawing order. | |
OrderedLayers | Layers in the drawing order. |
The code below illustrates how you can get the drawing order of the globe layers by their type (Draped, Floating, Elevation):
public void GetGlobeDrawingOrder()
{
//pGlobe is a variable of type IGlobe
IGlobeDisplay pGlbDisplay = pGlobe.GlobeDisplay;
IGlobeDrawingOrder pDrawOrder = (IGlobeDrawingOrder) pGlobe;
//Get the current draw order - this includes draped, floating and elevation
IEnumLayer pEnumLayer = pDrawOrder.OrderedLayers;
//Need to separate Draped from Elevation
IEnumLayer pBaseLayers;
IEnumLayer pFloatingLayers;
//Syntax
//variable = pGlobe.GlobeLayers(pUID, bRecursive, bInBaseGlobe, bSortedByDrawingPriority)
pBaseLayers = pGlobe.get_GlobeLayers(null,true,true,true);
pFloatingLayers = pGlobe.get_GlobeLayers(null,false,false,true);
/*weed out elevation layers from the ordered list...
note elevation layers are always on top of the ordered list
The ordered list for baselayers is:
(Top down)
Elevation0
Elevation1
Draped0
Draped1
....*/
IGlobeLayerProperties pGlobeLyrProps;
IGlobeDisplayLayers pGlbDispLyrs = (IGlobeDisplayLayers) pGlbDisplay;
//Create ArrayLists
ArrayList pDrapedLayers = new ArrayList();
ArrayList pElevationLayers = new ArrayList();
//Store the separate draw order (elevationa and draped) into ArrayLists
ILayer pLayer = pBaseLayers.Next();
while(pLayer != null)
{
pGlobeLyrProps = pGlbDispLyrs.FindGlobeProperties(pLayer);
if(pGlobeLyrProps.Type != esriGlobeDataType.esriGlobeDataElevation)
{
pDrapedLayers.Add(pLayer);
}
else if(pGlobeLyrProps.Type == esriGlobeDataType.esriGlobeDataElevation)
{
pElevationLayers.Add(pLayer);
}
//Get the next layer
pLayer = pBaseLayers.Next();
}
//To get the layers from the ArrayLists - cast individual elements to ILayer
//For example getting the first layer in the list:
ILayer theDrapedLayer = (ILayer) pDrapedLayers[0];
ILayer theElevationLayer = (ILayer) pElevationLayers[0];
//Get the floating layers
ILayer theFloatingLayer = pFloatingLayers.Next();
while(theFloatingLayer != null)
{
//code to work with theFloatingLayer
theFloatingLayer = pFloatingLayers.Next();
}
}