This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ESRI.ArcGIS.Snippets > Snippets > Add Globe Layer by Type Snippet (ArcObjects .NET 10.4 SDK) |
Add a globelayer as draped, floating or elevation type.
///<summary>Add a globelayer as draped, floating or elevation type.</summary> /// ///<param name="globe">An IGlobe interface</param> ///<param name="globeLayerType">An esriGlobeLayerType enum. Example: ESRI.ArcGIS.GlobeCore.esriGlobeLayerType.esriGlobeLayerTypeDraped</param> ///<param name="layer">An ILayer interface</param> /// ///<remarks></remarks> public void AddGlobeLayerByType(ESRI.ArcGIS.GlobeCore.IGlobe globe, ESRI.ArcGIS.GlobeCore.esriGlobeLayerType globeLayerType, ESRI.ArcGIS.Carto.ILayer layer) { if (globe == null) return; if (globeLayerType == ESRI.ArcGIS.GlobeCore.esriGlobeLayerType.esriGlobeLayerTypeElevation) { if (layer is ESRI.ArcGIS.Carto.IRasterLayer || layer is ESRI.ArcGIS.Carto.ITinLayer || layer is ESRI.ArcGIS.Carto.ITerrainLayer) { globe.AddLayerType(layer, globeLayerType, true); } return; } // else if GlobeLayerType is esriGlobeLayerTypeDraped or esriGlobeLayerTypeFloating globe.AddLayerType(layer, globeLayerType, true); }
'''<summary>Add a globelayer as draped, floating or elevation type.</summary> ''' '''<param name="globe">An IGlobe interface</param> '''<param name="globeLayerType">An esriGlobeLayerType enum. Example: ESRI.ArcGIS.GlobeCore.esriGlobeLayerType.esriGlobeLayerTypeDraped</param> '''<param name="layer">An ILayer interface</param> ''' '''<remarks></remarks> Public Sub AddGlobeLayerByType(ByVal globe As ESRI.ArcGIS.GlobeCore.IGlobe, ByVal globeLayerType As ESRI.ArcGIS.GlobeCore.esriGlobeLayerType, ByVal layer As ESRI.ArcGIS.Carto.ILayer) If globe Is Nothing Then Return End If If globeLayerType=ESRI.ArcGIS.GlobeCore.esriGlobeLayerType.esriGlobeLayerTypeElevation Then If TypeOf layer Is ESRI.ArcGIS.Carto.IRasterLayer OrElse TypeOf layer Is ESRI.ArcGIS.Carto.ITinLayer OrElse TypeOf layer Is ESRI.ArcGIS.Carto.ITerrainLayer Then globe.AddLayerType(layer, globeLayerType, True) End If Return End If globe.AddLayerType(layer, globeLayerType, True) End Sub