MapLibre: implement the adjacency route-badge layer (parity with Google, #1827)#1930
Merged
Conversation
Mirrors GoogleMapRenderer's route-badge rendering (#1827): a routeBadgeByMarker map tracks tap targets, renderRouteBadges() draws each badge as a classic Marker with a bitmap icon reused from the shared ContinuationBadgeBitmaps generator, and the compose adapter's click listener routes a badge tap to ObaMapCallbacks.onRouteBadgeClick(), same as the Google flavor. No anchor call is needed (maplibre centers a classic Marker's icon by default) and there's no z-index equivalent, so badges are simply drawn last to stay on top. Also updates the doc comments across MapRenderState.kt, GoogleMapRenderer.kt, and RouteViewGeometry.kt that described this as a Google-only / MapLibre- deferred layer, since both flavors now render it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughMapLibre now renders adjacency route badges as themed markers, retains marker-to-badge associations, exposes badge lookup, and routes badge taps to callbacks. Related KDoc comments now describe badge rendering across both map flavors. ChangesRoute-badge rendering parity
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MapLibreComposeAdapter
participant MapLibreRenderer
participant RouteBadge
participant Callback
MapLibreComposeAdapter->>MapLibreRenderer: routeBadgeForMarker(marker)
MapLibreRenderer-->>MapLibreComposeAdapter: RouteBadge or null
MapLibreComposeAdapter->>RouteBadge: read routeId, routeShortName, directionId
MapLibreComposeAdapter->>Callback: onRouteBadgeClick(...)
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
RouteBadge, Adjacency focus: on stop tap, draw the routes serving it, dim other stops, badge routes to tap into #1827) inMapLibreRenderer, previously rendered only byGoogleMapRenderer.renderRouteBadges()mirrors the Google flavor: arouteBadgeByMarkertap-target map, drawn last (no z-index in maplibre's classic annotation API, so draw order is the ordering mechanism), reusing the sharedContinuationBadgeBitmaps.badge(...)bitmap generator viaiconFactory.fromBitmap(...). No.anchor()call is needed since maplibre's classicMarkercenters its icon by default.MapLibreComposeAdapter's marker-click listener toObaMapCallbacks.onRouteBadgeClick(...), same callback the Google flavor already fires — no changes needed to the shared callback interface orMapFeature's handler.MapRenderState.kt,GoogleMapRenderer.kt, andRouteViewGeometry.ktthat described this as a Google-only / MapLibre-deferred layer, since both flavors now render it.Closes #1913.
Test plan
./gradlew :onebusaway-android:compileObaGoogleDebugKotlin -PwarningsAsErrors=true— clean./gradlew :onebusaway-android:compileObaMaplibreDebugKotlin -PwarningsAsErrors=true— clean./gradlew :onebusaway-android:testObaGoogleDebugUnitTest :onebusaway-android:testObaMaplibreDebugUnitTest— pass🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation