Feature request #2738
Legend customizations are not saved in Composer Template
|Pull Request or Patch supplied:||Resolution:|
|Easy fix?:||No||Copied to github as #:||12798|
1. Create a composer legend group and add some items
2. Save the composer map as template
3. Reload the saved composer template
4. The legend group does exist no longer
[composer] Restore legend customisation from composer templates
This change allows customised legends within composer templates
to be correctly restored when creating a new composition from
the template in a different project.
The legend layers will be attached to any loaded layers with a
matching data source as the layer from the original template
Sponsored by ENEL, on behalf of Faunalia
#1 Updated by John Tull almost 10 years ago
Additionally, no information regarding customized legends is preserved when a template is loaded. Try creating a composer item, add a legend, then delete a few items. Add another with those items only. Save the template and load it in a new composer. All legend instances will be populated with every item in the map canvas.
My guess is these two items are related. Effectively, legend instances are not having any information saved other than location and font information.
I've changed the bug title from "Grouped Legend Items are not saved in Composer Template" to reflect this more general problem.
#2 Updated by Marco Hugentobler almost 10 years ago
The legend structure is saved in the template (see content of the xml file). However, a template can be opened in a project with totally different layers and therefore is expected to not restore the saved legend content (otherwise, the legend content would be wrong if opening the template in other projects).
It would however make sense to add a test if the legend id is present in the project.