Skip to content

Commit

Permalink
Add suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-BaptisteC committed Jan 28, 2024
1 parent 75c9835 commit 32231da
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AddPowerAttachment : OsmFilterQuestType<PowerAttachment>() {

override val elementFilter = """
nodes with
(power = tower or power = pole or power = insulator)
power ~ tower|pole|insulator
and !line_attachment
"""
override val changesetComment = "Specify line_attachment power support"
Expand All @@ -26,7 +26,7 @@ class AddPowerAttachment : OsmFilterQuestType<PowerAttachment>() {
override fun getHighlightedElements(element: Element, getMapData: () -> MapDataWithGeometry): Sequence<Element> {
val mapData = getMapData()
// and also show the (power) lines themselves
return mapData.filter("nodes with power = tower or power = pole or power = insulator") +
return mapData.filter("nodes with power ~ tower|pole|insulator") +
mapData.filter("ways with power ~ line|minor_line")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import de.westnordost.streetcomplete.view.image_select.Item
fun PowerAttachment.asItem() = Item(this, iconResId, titleResId)

private val PowerAttachment.titleResId: Int get() = when (this) {
SUSPENSION -> R.string.quest_powerAttachment_suspension
ANCHOR -> R.string.quest_powerAttachment_anchor
SUSPENSION -> R.string.quest_powerAttachment_suspension
ANCHOR -> R.string.quest_powerAttachment_anchor
PIN -> R.string.quest_powerAttachment_pin
}

private val PowerAttachment.iconResId: Int get() = when (this) {
SUSPENSION -> R.drawable.power_attachment_suspension
ANCHOR -> R.drawable.power_attachment_anchor
SUSPENSION -> R.drawable.power_attachment_suspension
ANCHOR -> R.drawable.power_attachment_anchor
PIN -> R.drawable.power_attachment_pin
}
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ If there are no signs along the whole street which apply for the highlighted sec
<string name="quest_postboxRoyalCypher_type_none">No royal cypher is visible</string>
<string name="quest_postboxRoyalCypher_type_scottish_crown">The Crown of Scotland</string>

<string name="quest_powerAttachment_title">How power line is attached on this support?</string>
<string name="quest_powerAttachment_title">How is this power line attached?</string>
<string name="quest_powerAttachment_suspension">Suspension</string>
<string name="quest_powerAttachment_anchor">Anchor</string>
<string name="quest_powerAttachment_pin">Pin</string>
Expand Down

0 comments on commit 32231da

Please sign in to comment.