diff --git a/map_machine/map_configuration.py b/map_machine/map_configuration.py index a310977..6c2ccff 100644 --- a/map_machine/map_configuration.py +++ b/map_machine/map_configuration.py @@ -34,6 +34,7 @@ class BuildingMode(Enum): Building drawing mode. """ + NO: str = "no" FLAT: str = "flat" ISOMETRIC: str = "isometric" ISOMETRIC_NO_PARTS: str = "isometric-no-parts" @@ -55,6 +56,7 @@ class MapConfiguration: show_tooltips: bool = False country: str = "world" ignore_level_matching: bool = False + draw_roofs: bool = True @classmethod def from_options( @@ -72,6 +74,7 @@ class MapConfiguration: options.show_tooltips, options.country, options.ignore_level_matching, + options.draw_roofs, ) def is_wireframe(self) -> bool: diff --git a/map_machine/mapper.py b/map_machine/mapper.py index 6588f5c..d8046cf 100644 --- a/map_machine/mapper.py +++ b/map_machine/mapper.py @@ -125,6 +125,8 @@ class Map: def draw_buildings(self, constructor: Constructor) -> None: """Draw buildings: shade, walls, and roof.""" + if self.configuration.building_mode == BuildingMode.NO: + return if self.configuration.building_mode == BuildingMode.FLAT: for building in constructor.buildings: building.draw(self.svg, self.flinger) @@ -146,9 +148,10 @@ class Map: continue building.draw_walls(self.svg, height, previous_height, scale) - for building in constructor.buildings: - if building.height == height: - building.draw_roof(self.svg, self.flinger, scale) + if self.configuration.draw_roofs: + for building in constructor.buildings: + if building.height == height: + building.draw_roof(self.svg, self.flinger, scale) previous_height = height diff --git a/map_machine/ui.py b/map_machine/ui.py index e0afb80..155d32b 100644 --- a/map_machine/ui.py +++ b/map_machine/ui.py @@ -20,7 +20,7 @@ COMMANDS: dict[str, list[str]] = { "render", "-b", "10.000,20.000,10.001,20.001", - "--show-tooltips", + "--tooltips", ], "icons": ["icons"], "mapcss": ["mapcss"], @@ -115,7 +115,7 @@ def add_map_arguments(parser: argparse.ArgumentParser) -> None: metavar="", ) parser.add_argument( - "--show-tooltips", + "--tooltips", help="add tooltips with tags for icons in SVG files", action=argparse.BooleanOptionalAction, default=False, @@ -132,6 +132,12 @@ def add_map_arguments(parser: argparse.ArgumentParser) -> None: action=argparse.BooleanOptionalAction, default=False, ) + parser.add_argument( + "--roofs", + help="draw building roofs", + action=argparse.BooleanOptionalAction, + default=True, + ) def add_tile_arguments(parser: argparse.ArgumentParser) -> None: