Add two-way binding between map cluster markers and the trail list sidebar in the geography explorer's state trail view.
Problem
Previously, clicking a trail name in the right-hand list would center the map and render the trail's GeoJSON line — but clicking a single marker on the map did nothing beyond showing a popup. There was no way to go from map → list.
Solution
CountryMapComponent
Added trailMarkerClicked output that emits the trailId when a single cluster marker is clicked
Each marker in renderClusterMarkers now has a click handler using the existing ClusterMarkerData.trailId field
StateTrailViewComponent
Added onMarkerClicked(trailId) handler that:
Selects the trail (sets selectedTrailId signal)
Fetches and renders the trail's geometry on the map
Scrolls the sidebar list to the matching trail card with smooth animation
Extracted shared showTrailGeometry() method used by both list-click and marker-click paths
Added data-trail-id attribute on each mat-card for scroll targeting via scrollIntoView()
Behavior
List → Map: Click card → pan map + show trail line (existing, unchanged)
Map → List: Click single marker → show trail line + scroll sidebar to card + highlight selection (new)
Click again on either side to deselect/clear (toggle behavior preserved)
## Summary
Add two-way binding between map cluster markers and the trail list sidebar in the geography explorer's state trail view.
## Problem
Previously, clicking a trail name in the right-hand list would center the map and render the trail's GeoJSON line — but clicking a single marker on the map did nothing beyond showing a popup. There was no way to go from map → list.
## Solution
### `CountryMapComponent`
- Added `trailMarkerClicked` output that emits the `trailId` when a single cluster marker is clicked
- Each marker in `renderClusterMarkers` now has a click handler using the existing `ClusterMarkerData.trailId` field
### `StateTrailViewComponent`
- Added `onMarkerClicked(trailId)` handler that:
- Selects the trail (sets `selectedTrailId` signal)
- Fetches and renders the trail's geometry on the map
- Scrolls the sidebar list to the matching trail card with smooth animation
- Extracted shared `showTrailGeometry()` method used by both list-click and marker-click paths
- Added `data-trail-id` attribute on each `mat-card` for scroll targeting via `scrollIntoView()`
### Behavior
- **List → Map**: Click card → pan map + show trail line (existing, unchanged)
- **Map → List**: Click single marker → show trail line + scroll sidebar to card + highlight selection (new)
- Click again on either side to deselect/clear (toggle behavior preserved)
## Files Changed
- `country-map.component.ts` — added output + marker click handler
- `state-trail-view.component.ts` — added `onMarkerClicked`, `showTrailGeometry`, `scrollToTrailCard`
- `state-trail-view.component.html` — wired `(trailMarkerClicked)` output + `data-trail-id` attribute
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Add two-way binding between map cluster markers and the trail list sidebar in the geography explorer's state trail view.
Problem
Previously, clicking a trail name in the right-hand list would center the map and render the trail's GeoJSON line — but clicking a single marker on the map did nothing beyond showing a popup. There was no way to go from map → list.
Solution
CountryMapComponenttrailMarkerClickedoutput that emits thetrailIdwhen a single cluster marker is clickedrenderClusterMarkersnow has a click handler using the existingClusterMarkerData.trailIdfieldStateTrailViewComponentonMarkerClicked(trailId)handler that:selectedTrailIdsignal)showTrailGeometry()method used by both list-click and marker-click pathsdata-trail-idattribute on eachmat-cardfor scroll targeting viascrollIntoView()Behavior
Files Changed
country-map.component.ts— added output + marker click handlerstate-trail-view.component.ts— addedonMarkerClicked,showTrailGeometry,scrollToTrailCardstate-trail-view.component.html— wired(trailMarkerClicked)output +data-trail-idattribute