From e4e73b5596b9cdb8677a42229cea90e2fd80fb53 Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Mon, 25 Nov 2024 13:55:30 +0100 Subject: [PATCH] sidewalk overlay: show pedestrian roads in same color as sidewalks --- .../overlays/sidewalk/SidewalkOverlay.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/overlays/sidewalk/SidewalkOverlay.kt b/app/src/main/java/de/westnordost/streetcomplete/overlays/sidewalk/SidewalkOverlay.kt index e63505ec59..317cd34790 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/overlays/sidewalk/SidewalkOverlay.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/overlays/sidewalk/SidewalkOverlay.kt @@ -83,12 +83,22 @@ private fun getSidewalkStyle(element: Element): PolylineStyle { val isNoSidewalkExpected = lazy { sidewalkTaggingNotExpected(element) || isPrivateOnFoot(element) } return PolylineStyle( - stroke = null, + stroke = getStreetStrokeStyle(element.tags), strokeLeft = sidewalks?.left.getStyle(isNoSidewalkExpected), strokeRight = sidewalks?.right.getStyle(isNoSidewalkExpected) ) } +private fun getStreetStrokeStyle(tags: Map): StrokeStyle? { + return when { + tags["highway"] == "pedestrian" -> + StrokeStyle(Color.SKY) + tags["highway"] == "living_street" || tags["living_street"] == "yes" -> + StrokeStyle(Color.SKY, dashed = true) + else -> null + } +} + private val sidewalkTaggingNotExpectedFilter by lazy { """ ways with highway ~ living_street|pedestrian|service|motorway_link|busway