Lucy uses the ILcyModelContentType and the ILcyGXYLayerType to decide where to insert a layer in the layer order. See Layer type providers and model type providers for more information about those interfaces.

The initial criterion for layer order is their model content type. For example, layers containing points are added on top of layers containing areas.

For layers with the same model content type, the layer type is considered. Editable layers are put on top of background layers and real-time layers are put on top of everything else.

Real-time layers are always inserted at the top regardless of their model content type, because of performance reasons. Lucy automatically adjusts the property setNumberOfCachedBackgroundLayers of every ILcdGXYView of every ILcyMapComponent to make sure that the real-time layers are not part of the cached background layers.

You can keep the layer paint order of a view in-sync with the hierarchical structure, or you can set up the layer paint order independently from the hierarchical structure. In Lucy, it is possible to switch between those two behaviors by adjusting the map add-on configuration file. For more information, see map_addon.cfg or Program: The property in the map_addon.cfg file.

Program: The property in the map_addon.cfg file
# If false, move operations on the view will be a best effort approach and keep the tree structure intact.
# When set to true, the order of the layers in the view and the layers in the hierarchical tree structure
# become independent of each other, as was the default behavior of versions prior to V9.
TLcyMapAddOn.independentOrderTreeLayeredSupport=true

Depending on the chosen mode, the layer order algorithm reacts differently to real-time layers. The default mode in Lucy is the one where the layer order in the flat list depends on the hierarchical structure.

Real-time layers in the dependent order mode

For performance reasons, real-time layers are moved on top of the background layers. Mixing real-time and non-real-time layers in a single ILcdLayerTreeNode in the dependent order mode may lead to problems, because it is not possible to move layers to any index. The real-time layers cannot be separated from the non-real-time layers. Therefore the whole node, including all its child layers, will be considered a real-time layer until all real-time layers are removed from the node. It is therefore recommended not to mix real-time and non real-time layers in a single node, because this could dramatically decrease performance.

Real-time layers in the independent order mode

When the layer order in the flat list is independent of the order in the hierarchical structure, each layer can be moved to any index without problems. This allows you to move only the real-time layers to the top of the view. If an ILcdLayerTreeNode with one real-time layer and one non-real-time layer is added, for example, the real-time layer will be moved to the upper part of the flat list, while the non-real-time layer and the layer node are kept between the other background layers.

In the hierarchical structure, the ILcdLayerTreeNode will still contain the real-time layer and the non-real-time layer.