Tree Legend
From Ka-Map Wiki
Tree legend allows you to organize your legend grouping layers in sub groups (Here you cand find a simple example based on spearfish dataset).
To use a tree legend style for kamap legend, simply add the "subgroup" keyword, at Layer level metadata in the mapfile, for each layer that you want to be grouped, followed by the list of subgroups names separated by "|" symbol.
for example:
setting for a layer
METADATA
"subgroup" "aaaa|bbbb|cccc"
END
the legend looks like
-aaaa
-bbbb
-cccc
layer
If you want the subgroup to appear closed at startup, simply use ":c" after the group name.
So if you set
METADATA
"subgroup" "aaaa|bbbb:c|cccc"
END
the legend looks like simply
-aaaa
+bbbb
If more layers belong to the same subgroup and you want the subgroup to
appear closed at startup, there is no need to specify ":c" for each layer, simply
specify :c for only one.
If some layers are grouped and others are not, the latter will appear at the end of the legend.

