- Added support for city selection in MapViewer, allowing users to click on cities to view details. - Integrated map layout data to improve city rendering and positioning. - Introduced SelectedCityPanel to display information about the selected city. - Updated map asset handling with utility functions for building asset URLs. - Enhanced state management in mapViewer store to track selected city. - Improved responsiveness and styling of map components. - Added new API endpoint for loading map layouts from legacy data.
32 lines
813 B
TypeScript
32 lines
813 B
TypeScript
import { defineStore } from 'pinia';
|
|
|
|
interface MapViewerState {
|
|
showCityName: boolean;
|
|
detailMode: boolean;
|
|
hoveredCityId: number | null;
|
|
selectedCityId: number | null;
|
|
}
|
|
|
|
export const useMapViewerStore = defineStore('mapViewer', {
|
|
state: (): MapViewerState => ({
|
|
showCityName: true,
|
|
detailMode: false,
|
|
hoveredCityId: null,
|
|
selectedCityId: null,
|
|
}),
|
|
actions: {
|
|
toggleCityName() {
|
|
this.showCityName = !this.showCityName;
|
|
},
|
|
toggleDetailMode() {
|
|
this.detailMode = !this.detailMode;
|
|
},
|
|
setHoveredCity(cityId: number | null) {
|
|
this.hoveredCityId = cityId;
|
|
},
|
|
setSelectedCity(cityId: number | null) {
|
|
this.selectedCityId = cityId;
|
|
},
|
|
},
|
|
});
|