feat(navi/ui): wire place.category from basemap kind:kind_detail and pick-from-map raw

- Labeled-feature setSelectedPlace: category from props.kind:kind_detail (or kind:* when
  only kind is present), else null.
- Pick-from-map route input (fetchReverse .then): category from reverse-geocode
  raw.osm_key:osm_value when present, else null. The .catch fallback has no raw -> null
  implicitly (key omitted).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt 2026-05-25 04:07:09 +00:00 committed by Ubuntu
commit a900a32863

View file

@ -2038,7 +2038,7 @@ const MapView = forwardRef(function MapView(_, ref) {
// Reverse geocode for name
fetchReverse(lat, lng).then((place) => {
const name = place?.name || lat.toFixed(5) + ", " + lng.toFixed(5)
const location = { lat, lon: lng, name, source: "map_click" }
const location = { lat, lon: lng, name, source: "map_click", category: (place?.raw?.osm_key && place?.raw?.osm_value) ? `${place.raw.osm_key}:${place.raw.osm_value}` : null }
if (pickingRouteField === "origin") {
setRouteStart(location)
} else if (pickingRouteField === "destination") {
@ -2286,6 +2286,8 @@ const MapView = forwardRef(function MapView(_, ref) {
address: null,
type: props.kind_detail || props.kind || null,
source: 'basemap_label',
// Auto-mode hint from basemap tags (null -> spatial fallback)
category: (props.kind && props.kind_detail) ? `${props.kind}:${props.kind_detail}` : (props.kind ? `${props.kind}:*` : null),
matchCode: null,
mode: 'feature',
featureId: featureId,