VERIFIED SOLUTION i
X

How to create a group layer in MapXtreme

UPDATED: December 18, 2017


To group layers together you will need to use the GroupLayer Class. The following code demonstrates how to do this:

C#:
public static void MapInfo_Mapping_GroupLayer(Map map) {
    // Open a table
    Table table = Session.Current.Catalog.OpenTable("mexico.tab");

    // Add a group layer.
    GroupLayer g = map.Layers.AppendGroup("mexico group", "group1");

    // Create a layer and add it to the group.
    FeatureLayer layer = new FeatureLayer(table);
    g.Add(layer);
}

Visual Basic:
Public Shared Sub MapInfo_Mapping_GroupLayer(ByVal map As Map)
    ' Open a table
    Dim table As Table = Session.Current.Catalog.OpenTable("mexico.tab")

    ' Add a group layer.
    Dim g As GroupLayer = map.Layers.AppendGroup("mexico group", "group1")

    ' Create a layer and add it to the group.
    Dim layer As FeatureLayer = New FeatureLayer(table)
    g.Add(layer)
End Sub
 

Environment Details

Products Affected: MapXtreme®
 

Downloads

  • No Downloads