Fix: Polyline-Layer-Visibility reagiert jetzt zuverlässig auf Redux-State
- setupPolylines wird im useEffect asynchron aufgerufen - Marker und Polylinien werden erst nach Abschluss der async-Operation gesetzt - Sichtbarkeit der Kabelstrecken (Kabel-Layer) wird korrekt auf der Karte
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
|
||||
# basePath wird jetzt in public/config.json gepflegt
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.330
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.331
|
||||
|
||||
@@ -25,4 +25,4 @@ NEXT_PUBLIC_USE_MOCKS=false
|
||||
# basePath wird jetzt in public/config.json gepflegt
|
||||
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.330
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.331
|
||||
|
||||
@@ -380,9 +380,10 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
});
|
||||
cleanupPolylinesForMemory(polylines, map);
|
||||
|
||||
// Setze neue Marker und Polylinien mit den aktuellen Daten
|
||||
// Setze neue Marker und Polylinien mit den aktuellen Daten (asynchron!)
|
||||
const updatePolylines = async () => {
|
||||
if (polylineVisible) {
|
||||
const { markers: newMarkers, polylines: newPolylines } = setupPolylines(
|
||||
const { markers: newMarkers, polylines: newPolylines } = await setupPolylines(
|
||||
map,
|
||||
linePositions,
|
||||
lineColors,
|
||||
@@ -443,6 +444,8 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
cleanupPolylinesForMemory(polylines, map);
|
||||
setPolylines([]);
|
||||
}
|
||||
};
|
||||
updatePolylines();
|
||||
}, [
|
||||
map,
|
||||
linePositions,
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "nodemap",
|
||||
"version": "1.1.330",
|
||||
"version": "1.1.331",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "nodemap",
|
||||
"version": "1.1.330",
|
||||
"version": "1.1.331",
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.13.3",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nodemap",
|
||||
"version": "1.1.330",
|
||||
"version": "1.1.331",
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.13.3",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
|
||||
Reference in New Issue
Block a user