Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The functionality I am seeking is to add a FeatureLayer (containing some data from a file selected for import) inside of a GroupLayer collecting all of the data from that particular source. The logic for creating the feature layer and adding it to the scene, and subsequently forcing it to refresh so that it draws, has been working for FeatureLayers some time. However, it doesn't work for GroupLayers. The refresh method is as such:

    public void RefreshLayerInDocument(ILayer layer)
                var sxdoc = this.Application.Document as ISxDocument;
                sxdoc.Scene.SceneGraph.Invalidate(layer, true, true);
                sxdoc.Scene.SceneGraph.Invalidate(sxdoc.Scene.SceneGraph.ActiveViewer, true, false);

Note that manually selecting Refresh on the TOC allows a proper refresh and everything works.

The code for creating the grouping and adding the feature layer to it takes the form;

            IGroupLayer newGroupLayer = new GroupLayer();
            newGroupLayer.Name = layerName;
            RefreshLayerInDocument(group as ILayer);

Altering the order of the Refresh calls on the group and the featurelayer has had no impact on the outcome, it still requires a manual refresh.

My thoughts are that there must be an invalidate call required for groups that I'm not aware of, but I haven't had any luck searching the documentation.

share|improve this question
Did you try assigning a spatial ref to ILayer.SpatialReference on the grouplayer? – Kirk Kuykendall Jan 3 '12 at 15:14
Did you get this solved? – Andy Mar 12 '14 at 15:25
I tried assigning a spatial ref to the group layer; and it seemed to have no effect. – Andy Mar 12 '14 at 15:30
Never did find a solution for this, ended up going in a different direction. – DBaker Apr 7 '14 at 23:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.