VERIFIED SOLUTION i
X

How to access selectable map layers in MapXtreme .NET

UPDATED: April 21, 2017


Using HasSelectable and GetSelecteble methods in MapInfo.Mapping.LayerHelper.LayerHelper class, it is possible to step through the layers in a mapControl object and check selectability.

C# Code:

foreach (MapInfo.Mapping.IMapLayer l in mapControl1.Map.Layers)
{
    if (MapInfo.Mapping.LayerHelper.HasSelectable(l))
     {
       if (MapInfo.Mapping.LayerHelper.GetSelectable(l))
        {
          System.Diagnostics.Debug.WriteLine("Layer " + l.Alias + " is           Selectable");
        }
      }
}

VB.NET Code:

Dim l As MapInfo.Mapping.IMapLayer

For Each l In mapControl1.Map.Layers

If MapInfo.Mapping.LayerHelper.HasSelectable(l) Then

If MapInfo.Mapping.LayerHelper.GetSelectable(l) Then

System.Diagnostics.Debug.WriteLine("Layer " & l.Alias & " is Selectable")

End If
End If
Next

Downloads

  • No Downloads