Support subway colors.

This commit is contained in:
Sergey Vartanov 2021-09-13 05:07:52 +03:00
parent e5c8c1e9c2
commit b99a2ae87e
2 changed files with 42 additions and 24 deletions

View file

@ -257,19 +257,36 @@ class Constructor:
self.roads.append(Road(line.tags, inners, outers, road_matcher))
return
processed: set[str] = set()
recolor: Optional[Color] = None
if line.tags.get("railway") == "subway":
for color_tag_key in ["color", "colour"]:
if color_tag_key in line.tags:
recolor = self.scheme.get_color(line.tags[color_tag_key])
processed.add(color_tag_key)
line_styles: list[LineStyle] = self.scheme.get_style(line.tags)
for line_style in line_styles:
if recolor is not None:
new_style: dict[str, Union[float, int, str]] = dict(
line_style.style
)
new_style["stroke"] = recolor.hex
line_style = LineStyle(new_style, line_style.priority)
self.figures.append(
StyledFigure(line.tags, inners, outers, line_style)
)
if (
if not (
line.get_tag("area") == "yes"
or is_cycle(outers[0])
and line.get_tag("area") != "no"
and self.scheme.is_area(line.tags)
):
processed: set[str] = set()
continue
priority: int
icon_set: IconSet

View file

@ -1843,8 +1843,9 @@ ways:
- tags: {railway: subway}
style:
stroke-width: 10
stroke: "#DDDDDD"
stroke-width: 3.5
opacity: 0.7
stroke: "#AAAAAA"
priority: 41
- tags: {railway: rail}
style: