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

Show nearby related POIs #3480

Merged
merged 45 commits into from
Nov 15, 2021
Merged

Show nearby related POIs #3480

merged 45 commits into from
Nov 15, 2021

Conversation

westnordost
Copy link
Member

@westnordost westnordost commented Nov 2, 2021

Fixes #3338, fixes #2354

This PR adds functionality that quests can highlight map data in its vicinity that is helpful / necessary for context of the quest.

Examples:

  • bicycle parking capacity: It would be helpful to know if the bicycle parking just a few meters beside the shown point is mapped as an own bicycle parking or there is just one POI for all of it
  • operator of an ATM: If there are several right next to each other from different operators, it would be nice to see which one of those is meant
  • openiing hours, shop vacancies: If the shop doesn't exist anymore, it would be helpful to know which shop is left and right of the shop for which the quest is asked so that one knows which one exactly is meant
  • power poles: if there is more than one power line, it would be good to see the actual power lines so it is easier to locate which one is meant

westnordost and others added 2 commits November 2, 2021 18:49
…g_bin_operator/AddClothingBinOperator.kt

Co-authored-by: Flo Edelmann <florian-edelmann@online.de>
@westnordost
Copy link
Member Author

Thanks for the review!

@westnordost
Copy link
Member Author

Device-2021-11-02-190324-1.mp4
Device-2021-11-02-190643-.mp4
Device-2021-11-02-190855-1.mp4

@FloEdelmann
Copy link
Member

In your first video, when opening the quest for Kiosk 104, it looks like the quest is actually for SuperBioMarkt, because its whole geometry is highlighted.

Is it possible to hide all other quest pins while the quest answer sheet is open? Then all highlighted geometries look completely different (violet background + icon) compared to the current quest geometry (orange background + quest marker pin).

That'd also make the example in your third video look better: There, a quest pin with a bike parking icon is shown above an area with a bike parking icon. If the quest pin is hidden, that eliminates the duplication.

@westnordost
Copy link
Member Author

westnordost commented Nov 2, 2021

Yes it is possible. If you want to test it yourself, add

  fun startFocusQuest(quest: Quest, offset: RectF) {
+ pinMode = PinMode.NONE
  geometryMapComponent?.beginFocusGeometry(quest.geometry, offset)

to QuestsMapFragment. (Probably not the proper place, but quick and dirty for testing)

I agree that it is much more clear/clean this way, but it results in a visual jerk every time the quest form is open and closed. It is probably possible to reduce this jerk, maybe even remove it altogether, not sure. It will be some effort though to cleanly refactor the code so that hide/show is faster.

@westnordost
Copy link
Member Author

westnordost commented Nov 2, 2021

I checked - hiding the quest pins can not be faster. And it's actually not that slow. Showing the quest pins again can be faster but only with more effort, i.e. more working around missing features in tangram-es.

The main issue is that it is not possible in tangram-es to switch the visibility of a layer. You can only clear it. So what is done when "hiding" any layer is to actually clear it. When it should be shown again, it is built up anew from data fetched from the database.

I added a feature request to tangrams/tangram-es#2299 , let's see what Matt thinks. Since there is already a convenience wrapper around tangram in Streetcomplete code, maybe the MapData class could also be wrapped to enable this functionality. It'd still be somewhat slower than some visibility-logic in tangram-es itself.

@westnordost westnordost marked this pull request as draft November 4, 2021 21:10
@westnordost
Copy link
Member Author

Will look on how it will be possible to change the "view mode" when the quest form is open.

@westnordost
Copy link
Member Author

Notes:

  • also for areas, should show outline so it is clear where one feature begins and ends
  • should only show nearby objects on same level (especially for shops) - if specified

@westnordost
Copy link
Member Author

westnordost commented Nov 10, 2021

so, left to do:

  • hide/show other quest pins while quest is open. tangram-es will implement showing/hiding of layers
  • optionally can remove logic handling clicking on other quests while this quest form is open
  • optionally can remove the extra highlighting of the tapped marker (the blue circle around the highlighted pin)

# Conflicts:
#	app/src/main/java/de/westnordost/streetcomplete/quests/postbox_collection_times/AddPostboxCollectionTimes.kt
@westnordost westnordost marked this pull request as ready for review November 15, 2021 14:18
@westnordost
Copy link
Member Author

westnordost commented Nov 15, 2021

Device-2021-11-15-152301-1.mp4

(Note the shops are on different levels in the mall)

@westnordost
Copy link
Member Author

Shout out to @matteblair: Thank for enabling this fast-switching between displayed layers in the new version of tangram-es!

@westnordost westnordost merged commit e9128e2 into master Nov 15, 2021
@FloEdelmann FloEdelmann deleted the show-nearby branch November 15, 2021 15:24
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.

Render power lines on the map Show other nearby objects of the same type when answering quests
4 participants