Skip to content

Commit

Permalink
Add support for setting defaultPrintLayout in themesConfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Jan 17, 2024
1 parent d04a416 commit 646004b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/config_generator/map_viewer_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,18 +455,20 @@ def theme_item(self, cfg_item, themes_config, assets_dir, autogenExternalLayers,

print_templates = cap.get('print_templates', [])
if print_templates:
if 'printLabelBlacklist' in cfg_item:
# NOTE: copy print templates to not overwrite original config
print_templates = [
template.copy() for template in print_templates
]
for print_template in print_templates:
# NOTE: copy print templates to not overwrite original config
print_templates = [
template.copy() for template in print_templates
]
for print_template in print_templates:
if 'printLabelBlacklist' in cfg_item:
# filter print labels
labels = [
label for label in print_template.get('labels', [])
if label not in cfg_item['printLabelBlacklist']
]
print_template['labels'] = labels

print_template['default'] = print_template['name'] == cfg_item.get('defaultPrintLayout')
item['print'] = print_templates

self.set_optional_config(cfg_item, 'printLabelConfig', item)
Expand Down

0 comments on commit 646004b

Please # to comment.