Make attribution more informative and translatable

This commit is contained in:
pathmapper 2022-12-21 14:18:14 +01:00 committed by Nyall Dawson
parent 9bcce8d9c7
commit 0e533cda96

View File

@ -503,7 +503,7 @@ LEAFLET_TEMPLATE = '''
minZoom: {minzoom}, minZoom: {minzoom},
maxZoom: {maxzoom}, maxZoom: {maxzoom},
tms: {tms}, tms: {tms},
attribution: 'Generated by TilesXYZ' attribution: '{attribution}'
}}).addTo(map); }}).addTo(map);
</script> </script>
</body> </body>
@ -600,7 +600,8 @@ class TilesXYZAlgorithmDirectory(TilesXYZAlgorithmBase):
tilesource="'file:///{}/{{z}}/{{x}}/{{y}}.{}'".format(output_dir_safe, self.tile_format.lower()), tilesource="'file:///{}/{{z}}/{{x}}/{{y}}.{}'".format(output_dir_safe, self.tile_format.lower()),
minzoom=self.min_zoom, minzoom=self.min_zoom,
maxzoom=self.max_zoom, maxzoom=self.max_zoom,
tms='true' if is_tms else 'false' tms='true' if is_tms else 'false',
attribution=self.tr('Created by QGIS algorithm:') + ' "' + self.displayName() + '"'
) )
with open(output_html, "w") as fh: with open(output_html, "w") as fh:
fh.write(html_code) fh.write(html_code)