diff --git a/README.md b/README.md index e693c0f7..6f42ebe4 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ python create_map_poster.py --city --country [options] | **OPTIONAL:** `--all-themes` | | Generate posters for all available themes | | | **OPTIONAL:** `--width` | `-W` | Image width in inches | 12 (max: 20) | | **OPTIONAL:** `--height` | `-H` | Image height in inches | 16 (max: 20) | +| **OPTIONAL:** `--no-text` | | Omit all text on poster | false | ### Multilingual Support - i18n diff --git a/create_map_poster.py b/create_map_poster.py index 3eab412b..44fd566d 100755 --- a/create_map_poster.py +++ b/create_map_poster.py @@ -493,6 +493,7 @@ def create_poster( display_city=None, display_country=None, fonts=None, + no_text=False, ): """ Generate a complete map poster with roads, water, parks, and typography. @@ -681,57 +682,58 @@ def create_poster( ) # --- BOTTOM TEXT --- - ax.text( - 0.5, - 0.14, - spaced_city, - transform=ax.transAxes, - color=THEME["text"], - ha="center", - fontproperties=font_main_adjusted, - zorder=11, - ) - - ax.text( - 0.5, - 0.10, - display_country.upper(), - transform=ax.transAxes, - color=THEME["text"], - ha="center", - fontproperties=font_sub, - zorder=11, - ) + if not no_text: + ax.text( + 0.5, + 0.14, + spaced_city, + transform=ax.transAxes, + color=THEME["text"], + ha="center", + fontproperties=font_main_adjusted, + zorder=11, + ) - lat, lon = point - coords = ( - f"{lat:.4f}° N / {lon:.4f}° E" - if lat >= 0 - else f"{abs(lat):.4f}° S / {lon:.4f}° E" - ) - if lon < 0: - coords = coords.replace("E", "W") + ax.text( + 0.5, + 0.10, + display_country.upper(), + transform=ax.transAxes, + color=THEME["text"], + ha="center", + fontproperties=font_sub, + zorder=11, + ) - ax.text( - 0.5, - 0.07, - coords, - transform=ax.transAxes, - color=THEME["text"], - alpha=0.7, - ha="center", - fontproperties=font_coords, - zorder=11, - ) + lat, lon = point + coords = ( + f"{lat:.4f}° N / {lon:.4f}° E" + if lat >= 0 + else f"{abs(lat):.4f}° S / {lon:.4f}° E" + ) + if lon < 0: + coords = coords.replace("E", "W") + + ax.text( + 0.5, + 0.07, + coords, + transform=ax.transAxes, + color=THEME["text"], + alpha=0.7, + ha="center", + fontproperties=font_coords, + zorder=11, + ) - ax.plot( - [0.4, 0.6], - [0.125, 0.125], - transform=ax.transAxes, - color=THEME["text"], - linewidth=1 * scale_factor, - zorder=11, - ) + ax.plot( + [0.4, 0.6], + [0.125, 0.125], + transform=ax.transAxes, + color=THEME["text"], + linewidth=1 * scale_factor, + zorder=11, + ) # --- ATTRIBUTION (bottom right) --- if FONTS: @@ -955,6 +957,12 @@ def list_themes(): choices=["png", "svg", "pdf"], help="Output format for the poster (default: png)", ) + parser.add_argument( + "--no-text", + action="store_true", + default=False, + help="Omit city name, country, and coordinates text from the poster", + ) args = parser.parse_args() @@ -1037,6 +1045,7 @@ def list_themes(): display_city=args.display_city, display_country=args.display_country, fonts=custom_fonts, + no_text=args.no_text, ) print("\n" + "=" * 50)