Fix stop markers rendering below lines
All station and bus stop markers now use zorder = max(line zorders) + 1, ensuring they always render on top of every transit line layer.
This commit is contained in:
@@ -192,13 +192,13 @@ def plot_stations(ax, stations, styling, active_styles):
|
|||||||
pts_by_style.setdefault(s, []).append((r.geometry.x, r.geometry.y))
|
pts_by_style.setdefault(s, []).append((r.geometry.x, r.geometry.y))
|
||||||
|
|
||||||
zord = styling["zorder"]
|
zord = styling["zorder"]
|
||||||
|
top_z = max(zord.values()) + 1 # all markers above all lines
|
||||||
for s in sorted(pts_by_style, key=lambda k: zord.get(k, 0)):
|
for s in sorted(pts_by_style, key=lambda k: zord.get(k, 0)):
|
||||||
pts = pts_by_style[s]
|
pts = pts_by_style[s]
|
||||||
sz = sizes.get(s, 3.0)
|
sz = sizes.get(s, 3.0)
|
||||||
z = zord.get(s, 5) + 0.5
|
|
||||||
ax.scatter([p[0] for p in pts], [p[1] for p in pts],
|
ax.scatter([p[0] for p in pts], [p[1] for p in pts],
|
||||||
s=sz ** 2, marker=marker, c=fill, edgecolors=edge,
|
s=sz ** 2, marker=marker, c=fill, edgecolors=edge,
|
||||||
linewidths=lw, zorder=z, alpha=1.0)
|
linewidths=lw, zorder=top_z, alpha=1.0)
|
||||||
|
|
||||||
|
|
||||||
def plot_bus_stops(ax, stops, styling, active_styles):
|
def plot_bus_stops(ax, stops, styling, active_styles):
|
||||||
@@ -220,10 +220,9 @@ def plot_bus_stops(ax, stops, styling, active_styles):
|
|||||||
lw = mk.get("linewidth", 0.8)
|
lw = mk.get("linewidth", 0.8)
|
||||||
shape = mk.get("shape", "circle")
|
shape = mk.get("shape", "circle")
|
||||||
marker = "o" if shape == "circle" else "s"
|
marker = "o" if shape == "circle" else "s"
|
||||||
z = styling["zorder"].get("bus", 1) + 0.5
|
top_z = max(styling["zorder"].values()) + 1
|
||||||
|
|
||||||
ax.scatter(bus.geometry.x, bus.geometry.y, s=sz ** 2, marker=marker,
|
ax.scatter(bus.geometry.x, bus.geometry.y, s=sz ** 2, marker=marker,
|
||||||
c=fill, edgecolors=edge, linewidths=lw, zorder=z, alpha=0.8)
|
c=fill, edgecolors=edge, linewidths=lw, zorder=top_z, alpha=0.8)
|
||||||
|
|
||||||
|
|
||||||
def label_stations(ax, stations, styling, active_styles):
|
def label_stations(ax, stations, styling, active_styles):
|
||||||
|
|||||||
Reference in New Issue
Block a user