mirror of
https://github.com/enzet/map-machine.git
synced 2025-08-02 16:19:20 +02:00
Fix road layers.
Draw roads layer by layer.
This commit is contained in:
parent
748b252d1e
commit
15466cb74c
3 changed files with 28 additions and 10 deletions
|
@ -245,6 +245,10 @@ class Road(Figure):
|
|||
except ValueError:
|
||||
pass
|
||||
|
||||
self.layer: float = 0
|
||||
if "layer" in tags:
|
||||
self.layer = float(tags["layer"])
|
||||
|
||||
def draw(
|
||||
self,
|
||||
svg: Drawing,
|
||||
|
@ -259,15 +263,18 @@ class Road(Figure):
|
|||
width = self.width
|
||||
else:
|
||||
width = self.matcher.default_width
|
||||
if extra_width and self.tags.get("bridge") == "yes":
|
||||
color = Color("#666666")
|
||||
cap: str = "round"
|
||||
if extra_width:
|
||||
cap = "butt"
|
||||
if self.tags.get("bridge") == "yes":
|
||||
color = Color("#666666")
|
||||
scale: float = flinger.get_scale(self.outers[0][0].coordinates)
|
||||
path_commands: str = self.get_path(flinger)
|
||||
path: Path = Path(d=path_commands)
|
||||
style: dict[str, Any] = {
|
||||
"fill": "none",
|
||||
"stroke": color.hex,
|
||||
"stroke-linecap": "round",
|
||||
"stroke-linecap": cap,
|
||||
"stroke-linejoin": "round",
|
||||
"stroke-width": scale * width + extra_width,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue