Skip to content

Commit

Permalink
sidewalk overlay: show pedestrian roads in same color as sidewalks
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Nov 25, 2024
1 parent 7e2fd27 commit e4e73b5
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String>): StrokeStyle? {

Check failure on line 92 in app/src/main/java/de/westnordost/streetcomplete/overlays/sidewalk/SidewalkOverlay.kt

View workflow job for this annotation

GitHub Actions / Kotlin

Function body should be replaced with body expression
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
Expand Down

0 comments on commit e4e73b5

Please sign in to comment.