added grafana, map react-leaflet
This commit is contained in:
27
apps/dispatch/app/_store/mapStore.ts
Normal file
27
apps/dispatch/app/_store/mapStore.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { popup } from "leaflet";
|
||||
import { create } from "zustand";
|
||||
|
||||
interface MapStore {
|
||||
popup: {
|
||||
isOpen: boolean;
|
||||
lat: number;
|
||||
lng: number;
|
||||
} | null;
|
||||
map: {
|
||||
center: L.LatLngExpression;
|
||||
zoom: number;
|
||||
};
|
||||
setPopup: (popup: MapStore["popup"]) => void;
|
||||
}
|
||||
|
||||
export const useMapStore = create<MapStore>((set, get) => ({
|
||||
map: {
|
||||
center: [51.5, 10.5],
|
||||
zoom: 6,
|
||||
},
|
||||
popup: null,
|
||||
setPopup: (popup) =>
|
||||
set((state) => ({
|
||||
popup: popup,
|
||||
})),
|
||||
}));
|
||||
Reference in New Issue
Block a user