mirror of
https://github.com/enzet/map-machine.git
synced 2025-07-12 14:17:57 +02:00
Support subway colors.
This commit is contained in:
parent
e5c8c1e9c2
commit
b99a2ae87e
2 changed files with 42 additions and 24 deletions
|
@ -257,19 +257,36 @@ class Constructor:
|
||||||
self.roads.append(Road(line.tags, inners, outers, road_matcher))
|
self.roads.append(Road(line.tags, inners, outers, road_matcher))
|
||||||
return
|
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)
|
line_styles: list[LineStyle] = self.scheme.get_style(line.tags)
|
||||||
|
|
||||||
for line_style in line_styles:
|
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(
|
self.figures.append(
|
||||||
StyledFigure(line.tags, inners, outers, line_style)
|
StyledFigure(line.tags, inners, outers, line_style)
|
||||||
)
|
)
|
||||||
if (
|
if not (
|
||||||
line.get_tag("area") == "yes"
|
line.get_tag("area") == "yes"
|
||||||
or is_cycle(outers[0])
|
or is_cycle(outers[0])
|
||||||
and line.get_tag("area") != "no"
|
and line.get_tag("area") != "no"
|
||||||
and self.scheme.is_area(line.tags)
|
and self.scheme.is_area(line.tags)
|
||||||
):
|
):
|
||||||
processed: set[str] = set()
|
continue
|
||||||
|
|
||||||
priority: int
|
priority: int
|
||||||
icon_set: IconSet
|
icon_set: IconSet
|
||||||
|
|
|
@ -1843,8 +1843,9 @@ ways:
|
||||||
|
|
||||||
- tags: {railway: subway}
|
- tags: {railway: subway}
|
||||||
style:
|
style:
|
||||||
stroke-width: 10
|
stroke-width: 3.5
|
||||||
stroke: "#DDDDDD"
|
opacity: 0.7
|
||||||
|
stroke: "#AAAAAA"
|
||||||
priority: 41
|
priority: 41
|
||||||
- tags: {railway: rail}
|
- tags: {railway: rail}
|
||||||
style:
|
style:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue