VERIFIED SOLUTION i
X

Setting 'visible' and 'zoom' properties of a Group Layer in MapXtreme

UPDATED: July 25, 2018


It is possible to set both the visible and zoom properties of a group layer. These values will override any of the individual layer settings within the group layer. However, it is not possible to apply a style override to a group layer.

C# Code:
MapInfo.Mapping.GroupLayer lyrGroup = mapControl1.Map.Layers["GroupLayer1"] as MapInfo.Mapping.GroupLayer;
//This will set the layer's visibility
lyrGroup.Enabled = true; 
lyrGroup.VisibleRange = new MapInfo.Mapping.VisibleRange(0, 3000, MapInfo.Geometry.DistanceUnit.Mile);
lyrGroup.VisibleRangeEnabled = true;
VB.Net code:
Dim lyrGroup As MapInfo.Mapping.GroupLayer = MapControl1.Map.Layers.Item("GroupLayer1")
lyrGroup.Enabled = True 'This will set the layer's visibility

lyrGroup.VisibleRange = New MapInfo.Mapping.VisibleRange(0, 3000, MapInfo.Geometry.DistanceUnit.Mile)
lyrGroup.VisibleRangeEnabled = True



 

Environment Details

All Windows Platforms

Downloads

  • No Downloads