From 5f8cc03e30d622cd23ae312cbb46e3925869d837 Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Sat, 19 Aug 2023 08:15:16 +0000 Subject: [PATCH] extra logo hack --- images/FOSSGIS_Logo.svg | 538 +++++++++++++++++++++++ ocitysmap/__init__.py | 1 + ocitysmap/layoutlib/abstract_renderer.py | 7 +- render.py | 3 + 4 files changed, 547 insertions(+), 2 deletions(-) create mode 100644 images/FOSSGIS_Logo.svg diff --git a/images/FOSSGIS_Logo.svg b/images/FOSSGIS_Logo.svg new file mode 100644 index 0000000..3ac68c9 --- /dev/null +++ b/images/FOSSGIS_Logo.svg @@ -0,0 +1,538 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + FOSSGIS e.V. + + + http://www.fossgis.de + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ocitysmap/__init__.py b/ocitysmap/__init__.py index fc1fc9c..8275085 100644 --- a/ocitysmap/__init__.py +++ b/ocitysmap/__init__.py @@ -192,6 +192,7 @@ class RenderingConfiguration: # Logos self.logo = "bundled:osm-logo.svg" self.extra_logo = None + self.extra_text = None # custom QRcode text self.qrcode_text = None diff --git a/ocitysmap/layoutlib/abstract_renderer.py b/ocitysmap/layoutlib/abstract_renderer.py index a5042d8..839ba5c 100644 --- a/ocitysmap/layoutlib/abstract_renderer.py +++ b/ocitysmap/layoutlib/abstract_renderer.py @@ -501,7 +501,11 @@ class Renderer: annotations['sources'].append(_(u'Map data © %(osmyear)d OpenStreetMap contributors (see https://osm.org/copyright)') % dates) ### our own annotation string - annotations['maposmatic'] = _(u'Created using MapOSMatic/OCitySMap on %(date)s.') % dates + created = _(u'Created using MapOSMatic/OCitySMap on %(date)s.') % dates + if self.rc.extra_text is not None: + created = created + " " + self.rc.extra_text + + annotations['maposmatic'] = created ### process styles and overlays @@ -527,7 +531,6 @@ class Renderer: if overlay.datasource not in annotations['sources']: annotations['sources'].append(overlay.datasource) - return annotations diff --git a/render.py b/render.py index ecb8bc3..817e685 100755 --- a/render.py +++ b/render.py @@ -141,6 +141,7 @@ def main(): parser.add_option('--list', metavar='NAME', help="List avaibable choices for 'stylesheets', 'overlays', 'layouts', 'indexers' or 'paper-formats' option.") parser.add_option('--logo', metavar='NAME', help="SVG logo image URL, defaults to 'builtin:osm-logo.svg'") parser.add_option('--extra-logo', metavar='NAME', help="SVG logo image URL, defaults to None") + parser.add_option('--extra-text', metavar='NAME', help="Extra annotation text") # deprecated legacy options parser.add_option('--poi-file', metavar='FILE', dest='import_file', action='append', @@ -396,6 +397,8 @@ def main(): rc.logo = options.logo if options.extra_logo: rc.extra_logo = options.extra_logo + if options.extra_text: + rc.extra_text = options.extra_text # add actual import files if options.import_file: