fix(nearby): fan out co-located map pins so each stop is visible and tappable - #174
Closed
ai-tiro wants to merge 1 commit into
Closed
fix(nearby): fan out co-located map pins so each stop is visible and tappable#174ai-tiro wants to merge 1 commit into
ai-tiro wants to merge 1 commit into
Conversation
…tappable Different modes at one station share identical PTV coordinates — the Richmond train stop and the V/Line "Richmond Railway Station" are both stop_id 1162 at the same lat/lng. Rendered as-is their circles stacked on one pixel, so only the top stop was visible and the tap hit-test (nearest by true coordinate) could never resolve to the other. spreadColocatedStops() buckets stops by coordinate and fans any shared-point group evenly around a small (~20 m) circle, ordered by route type then id so a stop's nudged position is deterministic. It's the single source of display positions for both rendering and the tap hit-test, so a fanned-out dot is selectable exactly where it's drawn. Lone stops keep their exact coordinate. Chose the pixel-offset approach over re-enabling MapLibre clustering, which would reintroduce the #124 zoom-extreme bug it was removed to fix. Fixes #172 Co-Authored-By: ai-tiro <ai-tiro@jfx.ac> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Uploaded via |
|
Debug APK: app-debug-88e4d74cc42e9ed446336779f62f7556e63f0b6b.apk (built from Requires GitHub login. Artifact expires after 3 days. |
This was referenced Jun 20, 2026
Collaborator
Author
|
Superseded by #179, which combined these commits and has merged to master. Closing as superseded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What
Co-located map pins are now fanned apart so each stop is visible and individually tappable. Different modes serving one physical station share identical PTV coordinates — the Richmond train stop (route_type 0) and the V/Line "Richmond Railway Station" (route_type 3) are both
stop_id 1162at-37.82407, 144.99016. Rendered as-is, their circles stacked on a single pixel: only the top one was visible, and the tap hit-test (nearest stop by true coordinate) could never resolve to the other.How
New pure helper
spreadColocatedStops()(inColocationSpread.kt):MapLibreOpenPtvMapuses it as the single source of display positions for both rendering and the tap hit-test, so a fanned-out dot is selectable exactly where it's drawn (this was the subtle part — without updating the hit-test, the dots would look separated but both taps would still resolve to the same stop, since they share a true coordinate).Why pixel-offset, not clustering
You picked the offset approach. Re-enabling MapLibre clustering would reintroduce the #124 bug it was deliberately removed to fix (supercluster dropped stops at zoom extremes — metro vanished zoomed out, empty tiles zoomed in). The offset is a few metres, well under one stop's spacing, and keeps every stop visible at every zoom.
Testing
ColocationSpreadTest, 4 cases): lone stop unchanged; two co-located stops fanned to distinct points each ~20 m from the shared point and ~40 m apart; fan-out deterministic and independent of input order; genuinely distinct nearby stops not merged.:feature:nearbyunit suite green;:app:assembleDebuggreen.Discovered / notes
Fixes #172