save_map - support nested layers + serialize layer compositing mode
This commit is contained in:
parent
bb19ff948e
commit
a9aa1c69b8
1 changed files with 17 additions and 0 deletions
|
@ -514,6 +514,17 @@ void serialize_layer( ptree & map_node, layer const& lyr, bool explicit_defaults
|
|||
set_attr( layer_node, "name", lyr.name() );
|
||||
}
|
||||
|
||||
auto const comp_op = lyr.comp_op();
|
||||
|
||||
if (comp_op)
|
||||
{
|
||||
set_attr(layer_node, "comp-op", *comp_op_to_string(*comp_op));
|
||||
}
|
||||
else if (explicit_defaults)
|
||||
{
|
||||
set_attr(layer_node, "comp-op", "src-over");
|
||||
}
|
||||
|
||||
if ( lyr.srs() != "" )
|
||||
{
|
||||
set_attr( layer_node, "srs", lyr.srs() );
|
||||
|
@ -583,6 +594,12 @@ void serialize_layer( ptree & map_node, layer const& lyr, bool explicit_defaults
|
|||
{
|
||||
serialize_datasource( layer_node, datasource );
|
||||
}
|
||||
|
||||
// serialize nested layers
|
||||
for (auto const& child : lyr.layers())
|
||||
{
|
||||
serialize_layer(layer_node, child, explicit_defaults );
|
||||
}
|
||||
}
|
||||
|
||||
void serialize_map(ptree & pt, Map const& map, bool explicit_defaults)
|
||||
|
|
Loading…
Reference in a new issue