feat: implement MapCanvas and ScanTerminalDashboard components for interactive weather data visualization

This commit is contained in:
2569718930@qq.com
2026-04-24 13:28:38 +08:00
parent 168bf6987c
commit b94289a51a
2 changed files with 16 additions and 4 deletions
@@ -7,8 +7,10 @@ import { useLeafletMap } from "@/hooks/useLeafletMap";
export function MapCanvas({
onCitySelect,
selectionMode = "focus",
}: {
onCitySelect?: (cityName: string) => void;
selectionMode?: "focus" | "select";
} = {}) {
const store = useDashboardStore();
const { containerRef } = useLeafletMap({
@@ -21,6 +23,10 @@ export function MapCanvas({
onRegisterStopMotion: store.registerMapStopMotion,
onSelectCity: (cityName) => {
onCitySelect?.(cityName);
if (selectionMode === "select") {
void store.selectCity(cityName);
return;
}
void store.focusCity(cityName);
},
selectedCity: store.selectedCity,