WIP. polylines visiblity
This commit is contained in:
@@ -374,6 +374,10 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Prüfe Sichtbarkeit aus localStorage und Redux
|
||||
const localStoragePolylineVisible = localStorage.getItem("polylineVisible") === "true";
|
||||
const reduxPolylineLayerVisible = poiLayerVisible; // redux: polylineLayerVisible.visible
|
||||
|
||||
// vorherige Marker & Polylinien vollständig bereinigen
|
||||
(Array.isArray(markers) ? markers : []).forEach(marker => {
|
||||
marker.remove();
|
||||
@@ -382,7 +386,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
|
||||
// Setze neue Marker und Polylinien mit den aktuellen Daten (asynchron!)
|
||||
const updatePolylines = async () => {
|
||||
if (polylineVisible) {
|
||||
if (localStoragePolylineVisible && reduxPolylineLayerVisible) {
|
||||
const { markers: newMarkers, polylines: newPolylines } = await setupPolylines(
|
||||
map,
|
||||
linePositions,
|
||||
@@ -456,6 +460,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
tempMarker,
|
||||
polylineVisible,
|
||||
isTalasAllowed,
|
||||
poiLayerVisible,
|
||||
]);
|
||||
|
||||
//--------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user