|
|
|
|
@ -17,6 +17,8 @@ import { useMode } from "../stores/useMode";
|
|
|
|
|
import { MODE_TO_STATUS_MAPPER } from "../config";
|
|
|
|
|
import { FiltersButton } from "../modules/Sidebar/FiltersButton";
|
|
|
|
|
import { LayersControl } from "./LayersControl/LayersControl";
|
|
|
|
|
import { useTable } from "../stores/useTable";
|
|
|
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
|
|
|
|
|
|
export const MapComponent = () => {
|
|
|
|
|
const mapRef = useRef(null);
|
|
|
|
|
@ -25,6 +27,7 @@ export const MapComponent = () => {
|
|
|
|
|
const { setClickedPointConfig } = useClickedPointConfig();
|
|
|
|
|
const { setStatus } = useFilters();
|
|
|
|
|
const { mode } = useMode();
|
|
|
|
|
const { tableState, openTable } = useTable();
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setStatus(MODE_TO_STATUS_MAPPER[mode]);
|
|
|
|
|
@ -86,6 +89,12 @@ export const MapComponent = () => {
|
|
|
|
|
};
|
|
|
|
|
}, [mapContainerRef.current]);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (tableState.fullScreen && !tableState.isOpened) {
|
|
|
|
|
openTable();
|
|
|
|
|
}
|
|
|
|
|
}, [tableState.fullScreen]);
|
|
|
|
|
|
|
|
|
|
const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(false);
|
|
|
|
|
|
|
|
|
|
const toggleCollapseSidebar = () =>
|
|
|
|
|
@ -95,7 +104,10 @@ export const MapComponent = () => {
|
|
|
|
|
<MapProvider>
|
|
|
|
|
<Sidebar isCollapsed={isSidebarCollapsed} />
|
|
|
|
|
<div className="flex-1 h-screen flex flex-col ">
|
|
|
|
|
<div ref={mapContainerRef} className="flex-1">
|
|
|
|
|
<div
|
|
|
|
|
ref={mapContainerRef}
|
|
|
|
|
className={twMerge(tableState.fullScreen ? "" : "flex-1")}
|
|
|
|
|
>
|
|
|
|
|
<Map
|
|
|
|
|
mapLib={maplibregl}
|
|
|
|
|
// mapStyle={`https://api.maptiler.com/maps/voyager/style.json?key=${MAP_TILER_KEY}`}
|
|
|
|
|
|