WIP: Kabelstrecken
This commit is contained in:
@@ -24,4 +24,4 @@ NEXT_PUBLIC_USE_MOCKS=true
|
|||||||
# z.B. http://10.10.0.13/xyz/index.aspx -> basePath in config.json auf /xyz setzen
|
# z.B. http://10.10.0.13/xyz/index.aspx -> basePath in config.json auf /xyz setzen
|
||||||
# basePath wird jetzt in public/config.json gepflegt
|
# basePath wird jetzt in public/config.json gepflegt
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.1.338
|
NEXT_PUBLIC_APP_VERSION=1.1.339
|
||||||
|
|||||||
@@ -25,4 +25,4 @@ NEXT_PUBLIC_USE_MOCKS=false
|
|||||||
# basePath wird jetzt in public/config.json gepflegt
|
# basePath wird jetzt in public/config.json gepflegt
|
||||||
|
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.1.338
|
NEXT_PUBLIC_APP_VERSION=1.1.339
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
|||||||
const countdownActive = useSelector(state => state.polylineContextMenu.countdownActive);
|
const countdownActive = useSelector(state => state.polylineContextMenu.countdownActive);
|
||||||
const isPolylineContextMenuOpen = useSelector(state => state.polylineContextMenu.isOpen);
|
const isPolylineContextMenuOpen = useSelector(state => state.polylineContextMenu.isOpen);
|
||||||
const polylineVisible = useSelector(selectPolylineVisible);
|
const polylineVisible = useSelector(selectPolylineVisible);
|
||||||
|
const polylineInitialized = useSelector(state => state.polylineLayerVisible.isInitialized);
|
||||||
const GisSystemStatic = useSelector(selectGisSystemStatic);
|
const GisSystemStatic = useSelector(selectGisSystemStatic);
|
||||||
// Prüfen, ob TALAS (IdSystem 1) erlaubt ist
|
// Prüfen, ob TALAS (IdSystem 1) erlaubt ist
|
||||||
const isTalasAllowed = Array.isArray(GisSystemStatic)
|
const isTalasAllowed = Array.isArray(GisSystemStatic)
|
||||||
@@ -456,6 +457,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
|||||||
newCoords,
|
newCoords,
|
||||||
tempMarker,
|
tempMarker,
|
||||||
polylineVisible,
|
polylineVisible,
|
||||||
|
polylineInitialized,
|
||||||
isTalasAllowed,
|
isTalasAllowed,
|
||||||
poiLayerVisible,
|
poiLayerVisible,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { useSelector, useDispatch } from "react-redux";
|
|||||||
import {
|
import {
|
||||||
selectPolylineVisible,
|
selectPolylineVisible,
|
||||||
setPolylineVisible,
|
setPolylineVisible,
|
||||||
|
initializePolylineFromLocalStorageThunk,
|
||||||
} from "@/redux/slices/database/polylines/polylineLayerVisibleSlice";
|
} from "@/redux/slices/database/polylines/polylineLayerVisibleSlice";
|
||||||
import { selectGisSystemStatic } from "@/redux/slices/webservice/gisSystemStaticSlice";
|
import { selectGisSystemStatic } from "@/redux/slices/webservice/gisSystemStaticSlice";
|
||||||
import { selectGisStationsStaticDistrict } from "@/redux/slices/webservice/gisStationsStaticDistrictSlice";
|
import { selectGisStationsStaticDistrict } from "@/redux/slices/webservice/gisStationsStaticDistrictSlice";
|
||||||
@@ -14,6 +15,8 @@ import { setVisible } from "@/redux/slices/database/pois/poiLayerVisibleSlice";
|
|||||||
import { incrementZoomTrigger } from "@/redux/slices/zoomTriggerSlice";
|
import { incrementZoomTrigger } from "@/redux/slices/zoomTriggerSlice";
|
||||||
|
|
||||||
function MapLayersControlPanel() {
|
function MapLayersControlPanel() {
|
||||||
|
// Dummy state to force re-render after checkbox click (workaround for Redux/localStorage sync)
|
||||||
|
const [forceUpdate, setForceUpdate] = useState(0);
|
||||||
const [editMode, setEditMode] = useState(false); // Zustand für editMode
|
const [editMode, setEditMode] = useState(false); // Zustand für editMode
|
||||||
const [localStorageLoaded, setLocalStorageLoaded] = useState(false); // Tracking ob localStorage geladen wurde
|
const [localStorageLoaded, setLocalStorageLoaded] = useState(false); // Tracking ob localStorage geladen wurde
|
||||||
const kabelstreckenVisible = useSelector(selectPolylineVisible); // Redux State für Kabelstrecken
|
const kabelstreckenVisible = useSelector(selectPolylineVisible); // Redux State für Kabelstrecken
|
||||||
@@ -41,8 +44,10 @@ function MapLayersControlPanel() {
|
|||||||
const handlePolylineCheckboxChange = event => {
|
const handlePolylineCheckboxChange = event => {
|
||||||
const checked = event.target.checked;
|
const checked = event.target.checked;
|
||||||
dispatch(setPolylineVisible(checked));
|
dispatch(setPolylineVisible(checked));
|
||||||
dispatch(setPolylineVisible(checked));
|
// Synchronisiere Redux nach localStorage-Update
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
dispatch(initializePolylineFromLocalStorageThunk());
|
||||||
|
setForceUpdate(f => f + 1); // Force re-render
|
||||||
const event = new Event("polylineVisibilityChanged");
|
const event = new Event("polylineVisibilityChanged");
|
||||||
window.dispatchEvent(event);
|
window.dispatchEvent(event);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|||||||
Binary file not shown.
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "nodemap",
|
"name": "nodemap",
|
||||||
"version": "1.1.338",
|
"version": "1.1.339",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "nodemap",
|
"name": "nodemap",
|
||||||
"version": "1.1.338",
|
"version": "1.1.339",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.13.3",
|
"@emotion/react": "^11.13.3",
|
||||||
"@emotion/styled": "^11.13.0",
|
"@emotion/styled": "^11.13.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nodemap",
|
"name": "nodemap",
|
||||||
"version": "1.1.338",
|
"version": "1.1.339",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.13.3",
|
"@emotion/react": "^11.13.3",
|
||||||
"@emotion/styled": "^11.13.0",
|
"@emotion/styled": "^11.13.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user