diff --git a/src/save_map.cpp b/src/save_map.cpp index 008658849..f5825ce73 100644 --- a/src/save_map.cpp +++ b/src/save_map.cpp @@ -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)