Select to view content in your preferred language

globecontrol create a layer within an existing grouplayer

567
3
06-20-2012 05:23 AM
FabrizioPuddu2
Emerging Contributor
hi,

I am working with the globecontrol object (VB.NET). I create a grouplayer and I insert a layer (featurelayer polyline) into it. I need to know how do I create a layer (featurelayer polyline) within an existing grouplayer

thanks

fabrizio
0 Kudos
3 Replies
JohnHauck
Frequent Contributor
I'm not sure I follow the question. In general you can create a groupl layer and add with code similar to the following:

            IFeatureClass fc = getFeatureClass();
            IFeatureLayer fl = new FeatureLayer(){ FeatureClass = fc, Name = fc.AliasName};

            IGroupLayer gl = new GroupLayer();
            gl.Add(fl);

            axGlobeControl1.Globe.AddLayerType((ILayer)gl, esriGlobeLayerType.esriGlobeLayerTypeDraped, false);
0 Kudos
FabrizioPuddu2
Emerging Contributor
hi John,

sorry, I explained badly, I can create a grouplayer with a first layer (featurelayer), but I cannot I add after a second layer. I tried to put a second layer but the layer does not display.

I don't use AddlayerType, my code is this:

pFLy --> is my FeatureLayer
m_GroupLayer --> is my IGroupLayer


m_objGlobeControl.GlobeDisplay.Scene.AddLayer(m_GroupLayer, True)                // once at the beginning
m_GroupLayer.Add(pFLy)                           // when I use it for add a second layer it  does not display


thanks
0 Kudos
FabrizioPuddu2
Emerging Contributor
anyone can help me??
0 Kudos