Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix element highlighting in amenity_coverage #5212

Merged

Conversation

qugebert
Copy link
Contributor

In the AddAmenityCover-Task,

it is asked for coverage of various amenitys (picnic_table,bbq, maybe more in the future), but the getHighlightedElements(..) was still hardcoded to highlight picnic_tables, but should highlight elements of the same type than surveyed to avoid misunderstandings, which element should be checked.

This was mostly copy&paste from the logik used in the CheckExistence-quest.

In the AddAmenityCover-Task,

getHighlightedElements(..) highlighted picnic_tables when asked for bbq nodes.

Mostly copy&paste from the logik used in the CheckExistence-quest
@FloEdelmann FloEdelmann changed the title Fix element highlightning in amenity_coverage Fix element highlighting in amenity_coverage Aug 24, 2023
@westnordost
Copy link
Member

That's true, it is an issue and thank you very much for the fix!

Copy link
Member

@westnordost westnordost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, you made some extra changes that weren't in the title. Why not simply also highlight bbqs? I am not a fan of introducing complexity where it is not needed.

@qugebert
Copy link
Contributor Author

Hmm, you made some extra changes that weren't in the title. Why not simply also highlight bbqs? I am not a fan of introducing complexity where it is not needed.

I'm not sure, if i understand this right.
I thought, this would be the easiest way, as this was already implemented.
And if someone adds other types of amenities in the future, the highlighting doesn't need to be changed again as it always searches for the neighbour of the same type.
How should i do this instead? Sorry, i'm really new to kotlyn/android programming so thank you for any suggestins how i can do this better.

@westnordost
Copy link
Member

I guess you are right. In the future, the interface could be changed to be more straightforward to have less code in the individual quests, e.g.

class MyQuest(private val getFeature: (tags: Map<String, String>) -> Feature?) { ... }

@westnordost westnordost merged commit 548fc8e into streetcomplete:master Aug 27, 2023
@qugebert qugebert deleted the fix_amenity_coverage_highlightning branch October 13, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants