Files
next-tjwater-frontend/src/features/workbench/map/geocoding-location.ts
T
jiang ec23d44b02 feat(agent): support Responses steering and project-aware tools
Use the dedicated TJWATER_AGENT_URL and Responses stream protocol. Keep running
turns active while users steer or queue follow-ups and edit pending delivery.
Refresh the model catalog before generation and preserve approval mode selection.

Integrate scoped investigation messaging/presentation, geographic place selection,
current Agent composer styles and supporting workbench contracts.

Validation: 77 focused Vitest checks, 21 browser cases, lint, typecheck and
production build. Preserve direct Server/Agent routing and project authentication.
2026-10-19 18:46:58 +08:00

23 lines
917 B
TypeScript

import { Marker, type Map as MapLibreMap, type PaddingOptions } from "maplibre-gl";
import type { PlaceSearchItem } from "../api/place-search-client";
export function markGeocodingLocation(map: MapLibreMap, result: PlaceSearchItem) {
const marker = new Marker({ color: "var(--action-blue)" })
.setLngLat([result.longitude, result.latitude]).addTo(map);
const element = marker.getElement();
element.dataset.geocodingMarker = "true";
element.setAttribute("role", "img");
element.setAttribute("aria-label", `地址定位:${result.name} ${result.address}`);
element.title = `${result.name} · ${result.address}`;
return marker;
}
export function locateGeocodingResult(map: MapLibreMap, result: PlaceSearchItem, padding: PaddingOptions, reducedMotion: boolean) {
map.easeTo({
center: [result.longitude, result.latitude],
zoom: 16,
padding,
duration: reducedMotion ? 0 : 500
});
}