Setting globe layer cache properties
- Properly initialize the following variables:
- ESRI.ArcGIS.GlobeCore.IGlobeDisplay pGlobeDisplay
- ESRI.ArcGIS.Carto.ILayer pLayer—The layer for which the cache properties have to be set
- To set the layer cache properties, you need a handle to ESRI.ArcGIS.GlobeCore.IGlobeLayerProperties2 for the layer. See the following code example:
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)
- 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:
//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)
- Set the option to reduce the number of bits used to display colors for an image. See the following code example:
//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
- Set the minimum cell size (in meters) for raster layers. See the following code example:
//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
- Set the cache removal options. See the following code example:
//Set the cache removal options.
globeLayerProperties2.CacheRemovalOption =
esriGlobeLayerCacheRemovalOption.esriGlobeLayerExitRemoval;
[VB.NET]
'Set the cache removal options.
globeLayerProperties2.CacheRemovalOption = esriGlobeLayerCacheRemovalOption.esriGlobeLayerExitRemoval
- Once the layer properties have been set, refresh the layer. See the following code example:
//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):
ESRI.ArcGIS.3DAnalyst (ESRI.ArcGIS.Analyst3D)ESRI.ArcGIS.Carto ESRI.ArcGIS.GlobeCore
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 |