How to set globe layer cache properties


Summary
Disk caching creates a temporary file or cache for each layer in ArcGlobe, which helps you display and navigate your data efficiently. This topic shows how to set layer cache properties programmatically.

Setting globe layer cache properties

  1. Properly initialize the following variables:
  2. To set the layer cache properties, you need a handle to ESRI.ArcGIS.GlobeCore.IGlobeLayerProperties2 for the layer. See the following code example:
[C#]
IGlobeDisplayLayers globeDisplayLayers = pGlobeDisplay as IGlobeDisplayLayers;

//Get IGlobeLayerProperties.
IGlobeLayerProperties globeLayerProperties = globeDisplayLayers.FindGlobeProperties
    (pLayer);
IGlobeLayerProperties2 globeLayerProperties2 = globeLayerProperties as
    IGlobeLayerProperties2;
[VB.NET]
Dim globeDisplayLayers As IGlobeDisplayLayers = TryCast(pGlobeDisplay, IGlobeDisplayLayers)

'Get IGlobeLayerProperties.
Dim globeLayerProperties As IGlobeLayerProperties = globeDisplayLayers.FindGlobeProperties(pLayer)
Dim globeLayerProperties2 As IGlobeLayerProperties2 = TryCast(globeLayerProperties, IGlobeLayerProperties2)
  1. The ESRI.ArcGIS.GlobeCore.IGlobeLayerProperties2 interface exposes all the methods and properties that can be used to get and set the globe layer's cache properties. The following code example shows how to set the lossy compression option (Joint Photographics Experts Group [JPEG] or DirectX Texture Compression [DXT]) for raster layers:
[C#]
//Set the lossy compression option (JPEG or DXT) for raster layers.
globeLayerProperties2.CacheCompressionType = esriTextureFormatType.esriTextureJPEG;
globeLayerProperties2.PutLossyCompressionOption(true, 50);
[VB.NET]
'Set the lossy compression option (JPEG or DXT) for raster layers.
globeLayerProperties2.CacheCompressionType = esriTextureFormatType.esriTextureJPEG
globeLayerProperties2.PutLossyCompressionOption(True, 50)
  1. Set the option to reduce the number of bits used to display colors for an image. See the following code example:
[C#]
//Set the option to reduce the number of bits used to display colors for an image.
globeLayerProperties2.Use16ColorBits = true;
[VB.NET]
'Set the option to reduce the number of bits used to display colors for an image.
globeLayerProperties2.Use16ColorBits = True
  1. Set the minimum cell size (in meters) for raster layers. See the following code example:
[C#]
//Set the minimum cell size (in meters) for raster layers.
globeLayerProperties2.MinimumCellSize = 1;
[VB.NET]
'Set the minimum cell size (in meters) for raster layers.
globeLayerProperties2.MinimumCellSize = 1
  1. Set the cache removal options. See the following code example:
[C#]
//Set the cache removal options.
globeLayerProperties2.CacheRemovalOption =
    esriGlobeLayerCacheRemovalOption.esriGlobeLayerExitRemoval;
[VB.NET]
'Set the cache removal options.
globeLayerProperties2.CacheRemovalOption = esriGlobeLayerCacheRemovalOption.esriGlobeLayerExitRemoval
  1. Once the layer properties have been set, refresh the layer. See the following code example:
[C#]
//Refresh the layer.
globeDisplayLayers.RefreshLayer(pLayer);
[VB.NET]
'Refresh the layer.
globeDisplayLayers.RefreshLayer(pLayer)






To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
Development licensing Deployment licensing
ArcGIS for Desktop Basic: 3D Analyst ArcGIS for Desktop Basic: 3D Analyst
ArcGIS for Desktop Standard: 3D Analyst ArcGIS for Desktop Standard: 3D Analyst
ArcGIS for Desktop Advanced: 3D Analyst ArcGIS for Desktop Advanced: 3D Analyst
Engine Developer Kit Engine: 3D Analyst